@ristostevcev/callbag-to-promise

Convert a stream into a promise

Usage no npm install needed!

<script type="module">
  import ristostevcevCallbagToPromise from 'https://cdn.skypack.dev/@ristostevcev/callbag-to-promise';
</script>

README

callbag-to-promise

Convert an entire stream into a promise

Install

yarn install @ristostevcev/callbag-to-promise

Usage

const { pipe, interval, map, take } = require('callbag-basics')
const toPromise = require('@ristostevcev/callbag-to-promise')

pipe(
  interval(50),
  map(e => e * 2),
  take(5),
  toPromise
)
// Promise [0, 2, 4, 6, 8]

License

See LICENSE