File size: 320 Bytes
339aa1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;