migrated activeAccount state to rehook
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
import { atomWithStorage, createJSONStorage } from 'jotai/utils';
|
||||
|
||||
const createMyJsonStorage = () => {
|
||||
const storage = createJSONStorage(() => localStorage);
|
||||
const getItem = (key) => {
|
||||
const value = storage.getItem(key);
|
||||
return value;
|
||||
};
|
||||
return { ...storage, getItem };
|
||||
};
|
||||
|
||||
export const activeAccountAtom = atomWithStorage('activeAccount', {}, createMyJsonStorage());
|
||||
export const activeAccountFollowsAtom = atomWithStorage('activeAccountFollows', [], createMyJsonStorage());
|
||||
export const lastLoginAtom = atomWithStorage('lastLogin', [], createMyJsonStorage());
|
||||
Reference in New Issue
Block a user