mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 20:57:17 +01:00
15 lines
322 B
TypeScript
15 lines
322 B
TypeScript
import useStore from '@/store/modified';
|
|
|
|
export function useModified(key?: string) {
|
|
const modified = useStore(state => state?.[key]);
|
|
|
|
const touch = (id?: string) => {
|
|
if (id || key) {
|
|
useStore.setState({ [id || key]: Date.now() });
|
|
}
|
|
};
|
|
|
|
return { modified, touch };
|
|
}
|
|
|
|
export default useModified;
|