Package: effect
Module: TxPriorityQueue
Removes elements matching the predicate.
Example (Removing matching values)
import { Effect, Order, TxPriorityQueue } from "effect"
const program = Effect.gen(function*() {
const pq = yield* TxPriorityQueue.fromIterable(Order.Number, [1, 2, 3, 4, 5])
yield* TxPriorityQueue.removeIf(pq, (n) => n % 2 === 0)
const all = yield* TxPriorityQueue.takeAll(pq)
console.log(all) // [1, 3, 5]
})
Signature
declare const removeIf: { <A>(predicate: Predicate<A>): (self: TxPriorityQueue<A>) => Effect.Effect<void>; <A>(self: TxPriorityQueue<A>, predicate: Predicate<A>): Effect.Effect<void>; }
Since v2.0.0