Open jimdebeer opened 7 years ago
is this also a replacement of old is
, i remember that it accepted a function to test if it's time to go.
condition can be a function as well indeed
Scribbles:
Chain it
foo.on('data').once(true, () => {})
foo.on('click').once(() => {})
Arg it
foo.once('data', true, () => {})
foo.once('click', () => {})
Arg it 2
foo.once(true, () => {}, 'data')
foo.once(() => {}, 'click')
chain is totally doable going to that arg 2 is callbac
chain is a bit heavier though else it will become arg 2
if second is string like that as well
do we need this? and what kind of syntax?
once is now
.once('condition', cb
can do 2 things cb as a string means emitter
object as condition (options)