13 lines
315 B
TypeScript
13 lines
315 B
TypeScript
import { useSearchImageContext } from "@contexts/SearchImageContext";
|
|
import Fuse from "fuse.js";
|
|
|
|
export const useSearch = () => {
|
|
const { userImages } = useSearchImageContext();
|
|
|
|
return () =>
|
|
new Fuse(userImages(), {
|
|
shouldSort: true,
|
|
keys: ["Description"],
|
|
});
|
|
};
|