mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 06:45:46 +00:00
29 lines
521 B
TypeScript
29 lines
521 B
TypeScript
import { StateCreator } from 'zustand';
|
|
|
|
export interface TableState {
|
|
searchValue: string;
|
|
}
|
|
|
|
export interface TableUISlice {
|
|
searchValue: string;
|
|
setSearchValue: (value: string) => void;
|
|
resetSearchValue: () => void;
|
|
}
|
|
|
|
export const createTableUISlice: StateCreator<
|
|
TableUISlice,
|
|
[],
|
|
[],
|
|
TableUISlice
|
|
> = (set) => ({
|
|
// Initial state
|
|
searchValue: '',
|
|
|
|
// Actions
|
|
setSearchValue: (value) => set({ searchValue: value }),
|
|
|
|
resetSearchValue: () => {
|
|
return set({ searchValue: '' });
|
|
},
|
|
});
|