umami / src /components /hooks /useModified.ts
SreejithSHR's picture
Upload 1085 files
339aa1f verified
Raw History Blame Contribute Delete
320 Bytes
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;