update files-state, add toast, add zustand
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { create } from 'zustand'
|
||||
import { devtools } from 'zustand/middleware'
|
||||
|
||||
interface Store {
|
||||
value: any
|
||||
setValue: (value: any) => void
|
||||
}
|
||||
|
||||
export const useStoreWithDevtools = create<Store>()(
|
||||
devtools(
|
||||
(set) => ({
|
||||
value: 0,
|
||||
setValue: (value) => set({ value }),
|
||||
}),
|
||||
{
|
||||
name: 'DevStore', // имя для DevTools
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
/* пример */
|
||||
/* const setText = useStoreWithDevtools(s => s.setValue); */
|
||||
/* const text = useStoreWithDevtools(s => s.value); */
|
||||
Reference in New Issue
Block a user