MCPcopy Create free account
hub / github.com/experdot/pointer / getAccountStoreInterface

Function getAccountStoreInterface

src/renderer/src/stores/accountStore.ts:151–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149 * 获取账户 Store 的接口实现
150 */
151export function getAccountStoreInterface(): IAccountStore {
152 const store = useAccountStore
153 return {
154 get initialized() {
155 return store.getState().initialized
156 },
157 get accounts() {
158 return store.getState().accounts
159 },
160 get currentAccountId() {
161 return store.getState().currentAccountId
162 },
163 init: () => store.getState().init(),
164 reset: () => store.getState().reset(),
165 getById: (id) => store.getState().getById(id),
166 getAll: () => store.getState().getAll(),
167 create: (data) => store.getState().create(data),
168 createMany: (data) => store.getState().createMany(data),
169 update: (id, changes) => store.getState().update(id, changes),
170 updateMany: (updates) => store.getState().updateMany(updates),
171 delete: (id) => store.getState().delete(id),
172 deleteMany: (ids) => store.getState().deleteMany(ids),
173 setCurrentAccountId: (id) => store.getState().setCurrentAccountId(id),
174 setInitialized: (initialized) => store.getState().setInitialized(initialized)
175 }
176}
177
178export function getDefaultAccountId(): string {
179 return DEFAULT_ACCOUNT_ID

Callers 1

initStoresFunction · 0.90

Calls 12

createMethod · 0.80
createManyMethod · 0.80
updateManyMethod · 0.80
deleteManyMethod · 0.80
setInitializedMethod · 0.80
initMethod · 0.65
resetMethod · 0.65
getByIdMethod · 0.65
getAllMethod · 0.65
updateMethod · 0.65
deleteMethod · 0.65
setCurrentAccountIdMethod · 0.65

Tested by

no test coverage detected