Skip to content

ISearchable

Defined in: packages/data/src/collection/isearchable.ts:4

Predicate-driven removal and replacement.

T

remove(condition): IterableIterator<T>

Defined in: packages/data/src/collection/isearchable.ts:19

Removes every item matching the given predicate.

Predicate<[T]>

A predicate function to identify the items to remove.

IterableIterator<T>

An iterator of the removed items.


removeFirst(condition): boolean

Defined in: packages/data/src/collection/isearchable.ts:11

Removes the first occurrence of the item matching the given predicate.

Predicate<[T]>

A predicate function to identify the item to remove.

boolean

true if the item was found and removed, false otherwise.


replace(condition, newItemFactory): IterableIterator<T>

Defined in: packages/data/src/collection/isearchable.ts:38

Replaces every item matching the given predicate.

Predicate<[T]>

A predicate function to identify the items to replace.

Callable<[T], T>

A function that takes the old item and returns the new item to insert.

IterableIterator<T>

An iterator of the replaced items.


replaceFirst(condition, newItem): boolean

Defined in: packages/data/src/collection/isearchable.ts:28

Replaces the first occurrence of the item matching the given predicate.

Predicate<[T]>

A predicate function to identify the item to replace.

T

The new item to insert.

boolean

true if the item was found and replaced, false otherwise.