Skip to content

๐Ÿ‘œ Callbag operator that conditionally lets data pass through, now with Promisified/async conditional predicates

License

Notifications You must be signed in to change notification settings

fasiha/callbag-filter-promise

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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
                                      // 5

Note if you tried the above with just filter, 2 and 4 would be passed, since the condition returns a Promise object, which is truthy.

About

๐Ÿ‘œ Callbag operator that conditionally lets data pass through, now with Promisified/async conditional predicates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%