Created
May 26, 2018 16:26
-
-
Save WaldoJeffers/d1ee21bc21b0307fe04a071f6b7b7cca to your computer and use it in GitHub Desktop.
Filter using an asynchronous predicate with conductor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { filter } from 'conductor' | |
const numbers = [3, 1, 4] | |
const isEven = x => Promise.resolve(x % 2 === 0) | |
const result = await filter(isEven, numbers) // [4] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment