Skip to content

Support multiple event listeners for same event (callback array)

Compare
Choose a tag to compare
@therealPaulPlay therealPaulPlay released this 24 Jan 19:16
· 34 commits to main since this release

Now, you can register multiple callback functions for the same event type without having to do it all in one event listener.
For example:
peer.onEvent('status', status => console.log('Status:', status)); peer.onEvent('status', status => console.log('Status 2:', status));

...will execute both functions now, not just the latter one.