selectors: add extended search via Fuse.js
This commit is contained in:
@@ -7,9 +7,10 @@ import { IconEntry, IconCategory } from "../lib";
|
||||
import { icons } from "../lib/icons";
|
||||
|
||||
const fuse = new Fuse(icons, {
|
||||
keys: [{ name: "name", weight: 2 }, "tags", "categories"],
|
||||
keys: [{ name: "name", weight: 4 }, "tags", "categories"],
|
||||
threshold: 0.2, // Tweak this to what feels like the right number of results
|
||||
// shouldSort: false,
|
||||
useExtendedSearch: true,
|
||||
});
|
||||
|
||||
export const filteredQueryResultsSelector = selector<Readonly<IconEntry[]>>({
|
||||
|
||||
Reference in New Issue
Block a user