rete icon indicating copy to clipboard operation
rete copied to clipboard

There is no removeListener to prevent duplicate eventListener

Open ilomon10 opened this issue 5 years ago • 0 comments

How to removeListener on editor.

useEffect(()=> {
  const handler = ()=>console.log('its duplicate');
  editor.on('process', handler);

  return() {
    /* Maybe u can add `off` function to remove previous listener */
    editor.off('process', handler);
  }
}, [/* dynamic state */]);

ilomon10 avatar Aug 27 '20 09:08 ilomon10