Just like how Cold Observables set up their emitter when they are first subscribed to, something similar should be done here. Using Emittery.listenerAdded
, it is possible to detect when events are first listened to so it should be easy to invoke a callback from there.
For example:
const Emittery = require('emittery');
const emitter = new Emittery();
emitter.setup('name', () => {
// Prepare emitter...
});
// Invoke preparation logic
emitter.on('name', () => {
//...
})
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too