npm.io
1.0.0 • Published 7 years ago

tallbag-from-promise

Licence
MIT
Version
1.0.0
Deps
2
Size
7 kB
Vulns
0
Weekly
0
Stars
2

tallbag-from-promise

Convert a Promise to a tallbag listenable source.

npm install tallbag-from-promise

example

const fromPromise = require('tallbag-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