wip: migrate to zustand
This commit is contained in:
13
src/stores/accounts.tsx
Normal file
13
src/stores/accounts.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getActiveAccount } from "@utils/storage";
|
||||
import { create } from "zustand";
|
||||
|
||||
export const useActiveAccount = create((set) => ({
|
||||
account: null,
|
||||
fetch: async () => {
|
||||
const response = await getActiveAccount();
|
||||
set({ account: response });
|
||||
},
|
||||
updateFollows: (list: any) => {
|
||||
set((state: any) => ({ account: { ...state.account, follows: list } }));
|
||||
},
|
||||
}));
|
||||
Reference in New Issue
Block a user