Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

callbag-to-promise

Andarist3.4kMIT1.0.1

👜 Callbag operator which converts source to a promise containing last emitted value.

callbag, callbags

readme

callbag-to-promise

Callbag operator which converts source to a promise containing last emitted value.

Example

import interval from 'callbag-interval'
import pipe from 'callbag-pipe'
import takeUntil from 'callbag-take-until'
import toPromise from 'callbag-to-promise'

pipe(
  interval(30),
  takeUntil(interval(200)),
  toPromise,
).then(value => {
  console.log(value) // 5
})