Thanks to visit codestin.com
Credit goes to github.com

Skip to content

1.0.9

Latest

Choose a tag to compare

@apsonex apsonex released this 13 Jul 21:41
· 5 commits to master since this release

🛠 Fix: Event Listener Cleanup Support

Event listeners registered via events.<name>.listen() now return a cleanup function, allowing proper removal of listeners (e.g. in onBeforeUnmount in Vue). This prevents memory leaks and ensures multiple listeners can coexist safely.

Usage:

const unlisten = events.insertPlaceholder.listen((payload) => {
  // handle event
});

onBeforeUnmount(() => {
  unlisten(); // clean up
});