You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
468 B
18 lines
468 B
import { create } from 'zustand';
|
|
import { devtools } from 'zustand/middleware';
|
|
|
|
interface SearchState {
|
|
query: string;
|
|
isSearching: boolean;
|
|
setQuery: (query: string) => void;
|
|
toggleSearch: () => void;
|
|
}
|
|
|
|
export const useSearchStore = create<SearchState>()(
|
|
devtools((set) => ({
|
|
query: '',
|
|
isSearching: false,
|
|
setQuery: (query: string) => set({ query }),
|
|
toggleSearch: () => set((state) => ({ isSearching: !state.isSearching })),
|
|
})),
|
|
);
|
|
|