selectors: add extended search via Fuse.js

This commit is contained in:
rektdeckard
2020-09-23 16:04:48 -04:00
parent d46b7faf77
commit e23c6f43af

View File

@@ -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[]>>({