Détail du package

on-one

kmalakoff27.4kMIT0.1.9

Subscribe to one or more events and accept the first emitted

event, emitter, on, trigger

readme

on-one

Subscribe to one or more events and accept the first emitted.

one event

import oo = from 'on-one';

oo(stream, 'data', (chunk) => {
  // first chunk only
})

multiple events

import oo = from 'on-one';

oo(stream, ['error', 'finish'], (err) => {
  // it depends on if there was an error
})