eventemitter3 icon indicating copy to clipboard operation
eventemitter3 copied to clipboard

prependListener support

Open SachsKaylee opened this issue 6 years ago • 1 comments

#123 mentioned prependListener support and opted to not implement it back in late 2017.

This poses a problem as prependListener turns out to be quite quicial for our current project. preprendListener also seems to be a standard Node.js API function for event emitters: https://nodejs.org/api/events.html#events_emitter_prependlistener_eventname_listener

Is there a plan to suppot this feature in the near future? / Do you accept PRs for this?

//Edit:

For now I opted to create our own library with an API compatible with eventemitter3(It compiles and runs with Phaser3 which uses eventemitter3) which I alias in our webpack.config.js(alias: { 'eventemitter3': path.resolve(__dirname, './node_modules/sahnee-eventemitter') })

Instead of implementing the preprendListener function I went for a priority parameter here, which is not standard compilant by the looks of it but much more powerful. https://github.com/Sahnee-DE/eventemitter/blob/master/src/index.ts#L104

SachsKaylee avatar Aug 25 '19 20:08 SachsKaylee

prependListener support would be much appreciated

fabian-st avatar Aug 12 '23 18:08 fabian-st