Skip to content

Instantly share code, notes, and snippets.

@WaldoJeffers
Created May 26, 2018 16:26
Show Gist options
  • Save WaldoJeffers/d1ee21bc21b0307fe04a071f6b7b7cca to your computer and use it in GitHub Desktop.
Save WaldoJeffers/d1ee21bc21b0307fe04a071f6b7b7cca to your computer and use it in GitHub Desktop.
Filter using an asynchronous predicate with conductor
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