on-one
Version:
Subscribe to one or more events and accept the first emitted
22 lines (16 loc) • 321 B
Markdown
Subscribe to one or more events and accept the first emitted.
```
import oo = from 'on-one';
oo(stream, 'data', (chunk) => {
// first chunk only
})
```
```
import oo = from 'on-one';
oo(stream, ['error', 'finish'], (err) => {
// it depends on if there was an error
})
```