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

Package detail

callbag-from-promise

staltz6.5kMIT1.3.0TypeScript support: included

Convert a Promise to a callbag listenable source

callbag

readme

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