1.0.1 • Published 6 years ago

callbag-default-if-empty v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

callbag-default-if-empty

Callbag operator which emits a given value when source completes without emitting any value.

Example

import defaultIfEmpty from 'callbag-default-if-empty'
import forEach from 'callbag-for-each'
import fromEvent from 'callbag-from-event'
import interval from 'callbag-interval'
import pipe from 'callbag-pipe'
import takeUntil from 'callbag-take-until'

pipe(
  fromEvent(document, 'click'),
  takeUntil(interval(5000)),
  defaultIfEmpty('no clicks'),
  forEach(eventOrDefault => {
    console.log(eventOrDefault)
  }),
)
1.0.1

6 years ago

1.0.0

6 years ago