Have ideas to improve npm?Join in the discussion! »

    This package has been deprecated

    Author message:

    This package has been deprecated

    once-promised

    1.1.0 • Public • Published

    once-promised

    | Create a promise for an event, once

    usage

    import oncePromised from 'once-promised'
    const emitter = new EventEmitter()
     
    const promise = oncePromised(emitter, 'test')
     
    promise.then(arg => {
      console.log('The event fired!')
      console.log('the argument was:', arg)
      // => the argument was an argument
    })
     
    emitter.emit('test', 'an argument')

    It is also possible to pass an alternative promise implementation in as a third argument it will be called with new

    Keywords

    none

    Install

    npm i once-promised

    DownloadsWeekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • avatar