wip: migrate to zustand

This commit is contained in:
Ren Amamiya
2023-05-26 14:45:12 +07:00
parent 5c7b18bf29
commit 671b857077
34 changed files with 494 additions and 530 deletions

13
src/stores/accounts.tsx Normal file
View 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 } }));
},
}));