ISearchable
Defined in: packages/data/src/collection/isearchable.ts:4
Predicate-driven removal and replacement.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T
Methods
Section titled “Methods”remove()
Section titled “remove()”remove(
condition):IterableIterator<T>
Defined in: packages/data/src/collection/isearchable.ts:19
Removes every item matching the given predicate.
Parameters
Section titled “Parameters”condition
Section titled “condition”Predicate<[T]>
A predicate function to identify the items to remove.
Returns
Section titled “Returns”IterableIterator<T>
An iterator of the removed items.
removeFirst()
Section titled “removeFirst()”removeFirst(
condition):boolean
Defined in: packages/data/src/collection/isearchable.ts:11
Removes the first occurrence of the item matching the given predicate.
Parameters
Section titled “Parameters”condition
Section titled “condition”Predicate<[T]>
A predicate function to identify the item to remove.
Returns
Section titled “Returns”boolean
true if the item was found and removed, false otherwise.
replace()
Section titled “replace()”replace(
condition,newItemFactory):IterableIterator<T>
Defined in: packages/data/src/collection/isearchable.ts:38
Replaces every item matching the given predicate.
Parameters
Section titled “Parameters”condition
Section titled “condition”Predicate<[T]>
A predicate function to identify the items to replace.
newItemFactory
Section titled “newItemFactory”Callable<[T], T>
A function that takes the old item and returns the new item to insert.
Returns
Section titled “Returns”IterableIterator<T>
An iterator of the replaced items.
replaceFirst()
Section titled “replaceFirst()”replaceFirst(
condition,newItem):boolean
Defined in: packages/data/src/collection/isearchable.ts:28
Replaces the first occurrence of the item matching the given predicate.
Parameters
Section titled “Parameters”condition
Section titled “condition”Predicate<[T]>
A predicate function to identify the item to replace.
newItem
Section titled “newItem”T
The new item to insert.
Returns
Section titled “Returns”boolean
true if the item was found and replaced, false otherwise.