mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Refactor: removed default exports.
This commit is contained in:
parent
cd944e14ce
commit
f83a12d6cd
343 changed files with 555 additions and 1046 deletions
|
|
@ -1,15 +1,13 @@
|
|||
import useStore from '@/store/modified';
|
||||
import { create } from 'zustand';
|
||||
|
||||
const store = create(() => ({}));
|
||||
|
||||
export function touch(key: string) {
|
||||
store.setState({ [key]: Date.now() });
|
||||
}
|
||||
|
||||
export function useModified(key?: string) {
|
||||
const modified = useStore(state => state?.[key]);
|
||||
|
||||
const touch = (id?: string) => {
|
||||
if (id || key) {
|
||||
useStore.setState({ [id || key]: Date.now() });
|
||||
}
|
||||
};
|
||||
const modified = store(state => state?.[key]);
|
||||
|
||||
return { modified, touch };
|
||||
}
|
||||
|
||||
export default useModified;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue