krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
18.36k stars 772 forks source link

Add setCollection method to Fuse type definition file #258

Closed peterblazejewicz closed 6 years ago

peterblazejewicz commented 6 years ago

This allows to swap lists at runtime.

const fuse = new Fuse<Book>(oldBooks, options);
fuse.setCollection(newBooks);
const results: Book[] = fuse.search("old");

Thanks!