Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/staltz/callbag-from-promise

👜 Convert a Promise to a callbag listenable source
https://github.com/staltz/callbag-from-promise

Last synced: about 2 months ago
JSON representation

👜 Convert a Promise to a callbag listenable source

Awesome Lists containing this project

README

        

# callbag-from-promise

Convert a Promise to a callbag listenable source.

`npm install callbag-from-promise`

## example

```js
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
```