thunkify-wrap icon indicating copy to clipboard operation
thunkify-wrap copied to clipboard

Improve `thunkify.event()`

Open fritx opened this issue 10 years ago • 0 comments

Hey guys I really appreciate the method thunkify.event() However, I think it would be great to have something like this:

var eventify = require('thunkify-wrap').eventify
eventify(emitter)

co(function*(){
  yield emitter.once('ready') // returns a thunk if handler not provided
  yield function(done){
    emitter.once('finish', done) // works normally
  }
})

fritx avatar Oct 07 '15 14:10 fritx