Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/staltz/callbag-from-promise
👜 Convert a Promise to a callbag listenable source
https://github.com/staltz/callbag-from-promise
Last synced: 28 days ago
JSON representation
👜 Convert a Promise to a callbag listenable source
- Host: GitHub
- URL: https://github.com/staltz/callbag-from-promise
- Owner: staltz
- License: mit
- Created: 2018-01-26T17:18:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-22T06:19:44.000Z (over 2 years ago)
- Last Synced: 2024-10-10T08:27:45.678Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-callbags - from-promise
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
```