once-then
Add onceThen to your emitter to convert an event to a Promise.
Installation
npm install --save once-then
Usage
const EventEmitter = EventEmitter;const onceThen = ;
onceThen
works with the NodeJS event emitter or any events implementation that has its once
method backwards compatible with NodeJS events.
const emitter = ; ; emitter;
Register
Register onceThen
on an object.
onceThen; const emitter = ; emitter; emitter;