Hi,
I’m not sure how difficult this would be, but it would be nice if the JS event dispatcher worked more like the Lua side dispatcher (https://docs.coronalabs.com/api/library/system/newEventDispatcher.html).
I’m working with a plugin that dispatches a number of events and having only one listener option ends up requiring a lot of if/elseif statements.
The Lua dispatcher uses the “name” property as a key that can be listened for, allowing different listeners to be set up.
thing.addEventListener('init', onInit)
otherthing.dispatchEvent({name='init', data={ loaded = true }})
Can something similar be done with the JS dispatcher?
-dev