mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-30 13:41:50 +02:00
16 lines
320 B
TypeScript
16 lines
320 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;
|