retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
10.17k stars 653 forks source link

There is no removeListener to prevent duplicate eventListener #478

Closed ilomon10 closed 1 year ago

ilomon10 commented 4 years ago

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 */]);
rete-js[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.