Asynchronously filters an array of items: The Array.prototype.filter function does not allow to filter an array using asynchronous predicates. However by applying the filter function, it becomes possible to do so.
npm install @dizmo/functions-filter --saveconst { filter } = require('@dizmo/functions-filter');import { filter } from "@dizmo/functions-filter";const even_numbers = await filter([0,1,2,3,4], (n) => new Promise(
(resolve) => setTimeout(() => resolve(n % 2 === 0))
));const odd_numbers = await filter([0,1,2,3,4], (n) => new Promise(
(resolve) => setTimeout(() => resolve(n % 2 === 1))
));npm run cleannpm run buildnpm run -- build --no-lint --no-cleannpm run -- build --prepacknpm run -- build --prepack --no-minifynpm run lintnpm run -- lint --fixnpm run testnpm run -- test --no-lint --no-clean --no-buildnpm run covernpm run -- cover --no-lint --no-clean --no-buildnpm run docsnpm publishnpm publish --access=public© 2020 dizmo AG, Switzerland