Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fasiha/callbag-filter-promise
👜 Callbag operator that conditionally lets data pass through, now with Promisified/async conditional predicates
https://github.com/fasiha/callbag-filter-promise
Last synced: 3 months ago
JSON representation
👜 Callbag operator that conditionally lets data pass through, now with Promisified/async conditional predicates
- Host: GitHub
- URL: https://github.com/fasiha/callbag-filter-promise
- Owner: fasiha
- License: mit
- Fork: true (staltz/callbag-filter)
- Created: 2018-03-10T08:49:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T09:07:02.000Z (almost 7 years ago)
- Last Synced: 2024-10-20T11:33:03.790Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-callbags - filter-promise
README
callbag-filter-promise
----------------------A version of callbag-filter that works with async/await/Promisified predicates.
`npm install callbag-filter-promise`
Example:
const fromIter = require('callbag-from-iter');
const iterate = require('callbag-iterate');
const filterPromise = require('callbag-filter-promise');const source = filterPromise(async x => await x % 2)(fromIter([1,2,3,4,5]));
iterate(x => console.log(x))(source); // 1
// 3
// 5Note if you tried the above with just `filter`, 2 and 4 would be passed, since
the condition returns a Promise object, which is truthy.