old-documentation icon indicating copy to clipboard operation
old-documentation copied to clipboard

How to add multiple listeners to custom events?

Open tcdrop opened this issue 3 years ago • 0 comments

The documentation page "https://docs.decentraland.org/development-guide/custom-events/" states that to add a listener you have to call "events.addListener()".

That works for a single listener, but when adding a second one with the second parameter being "null", the error "The provided listener is already registered" is thrown.

The documentation should be more detailed instead of just saying "The listener to use. This will almost always be null." about the second parameter of the "addListener" function.

tcdrop avatar Aug 04 '22 13:08 tcdrop