Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 387 Bytes

use-filter.md

File metadata and controls

14 lines (11 loc) · 387 Bytes

useFilter

A hook-ified API wrapping Fuse.js to fuzzy-search arbitrary data.

Example

const filteredData = useFilter({
  needle: 'my search term',
  haystack: [/* arbitrary source data */],
  debounce: 0, // So you can debounce the (perhaps costly) fuzzy filter operation.
  searchOptions: { /* fuse.js options -> see https://fusejs.io/ */ },
});