Closed krisk closed 4 years ago
Add API which removes all documents from the list which the predicate returns truthy for, and returns an array of the removed docs.
The predicate is invoked with two arguments: (doc, index)
remove(predicate: (doc: T, idx: number) => boolean): T[]
Thus you can use it as such:
fuse.remove((doc) => { return doc === 'banana' || doc === 'pear' })
You'd have to know the index, and use the removeAt function instead.
removeAt
Now in latest fuse.js@6.2.0
fuse.js@6.2.0
Description
Add API which removes all documents from the list which the predicate returns truthy for, and returns an array of the removed docs.
Describe the solution you'd like
The predicate is invoked with two arguments: (doc, index)
Thus you can use it as such:
Describe alternatives you've considered
You'd have to know the index, and use the
removeAt
function instead.