import { useStoreState } from 'easy-peasy'; import { usePersistedState } from '@/plugins/usePersistedState'; import { Dispatch, SetStateAction } from 'react'; export default (key: string, defaultValue: S): [ S, Dispatch> ] => { const uuid = useStoreState(state => state.user.data!.uuid); return usePersistedState(`${uuid}:${key}`, defaultValue); };