callbag-from-promise
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

callbag-from-promise

Convert a Promise to a callbag listenable source.

npm install callbag-from-promise

example

const fromPromise = require('callbag-from-promise');
const observe = require('callbag-observe');
 
const source = fromPromise(
  fetch('http://jsonplaceholder.typicode.com/users/1')
    .then(res => res.json())
);
 
observe(user => console.log(user.name))(source); // Leanne Graham

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    199
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    199
  • 1.2.0
    0
  • 1.1.0
    2
  • 1.0.0
    196

Package Sidebar

Install

npm i callbag-from-promise

Weekly Downloads

397

Version

1.3.0

License

MIT

Unpacked Size

7.83 kB

Total Files

8

Last publish

Collaborators

  • staltz
  • zimme