Lazily filter synchronous or asynchronous sources with sync or async predicates. Evaluation remains sequential for ordered backpressure.
import { filterAsyncIterable } from "@lucid-softworks/async-iterable-filter";
const ids = [1, 2, 3];
const database = new Set([1, 3]);
const existing = filterAsyncIterable(ids, async (id) => database.has(id));
for await (const id of existing) {
console.log(id);
}