From 2c2a2f0a66719eab70232cbb53d5324e0702791e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=9B=A8?= Date: Fri, 9 Apr 2021 13:36:21 +0800 Subject: [PATCH] lacking of yarn build since #56 merged (#95) Co-authored-by: Archer --- lib/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/index.js b/lib/index.js index aa0846b..b6e9137 100644 --- a/lib/index.js +++ b/lib/index.js @@ -120,6 +120,13 @@ var Graph = function Graph(_ref) { var eventName = _Object$keys[_i]; network.current.on(eventName, events[eventName]); } + + return function () { + for (var _i2 = 0, _Object$keys2 = Object.keys(events); _i2 < _Object$keys2.length; _i2++) { + var _eventName = _Object$keys2[_i2]; + network.current.off(_eventName, events[_eventName]); + } + }; }, [events]); return /*#__PURE__*/_react["default"].createElement("div", { ref: container,