mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
13 lines
277 B
TypeScript
13 lines
277 B
TypeScript
import { create } from 'zustand';
|
|
|
|
const store = create(() => ({}));
|
|
|
|
export function touch(key: string) {
|
|
store.setState({ [key]: Date.now() });
|
|
}
|
|
|
|
export function useModified(key?: string) {
|
|
const modified = store(state => state?.[key]);
|
|
|
|
return { modified, touch };
|
|
}
|