mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: run app in closure (#3790)
This commit is contained in:
@@ -6,7 +6,19 @@ import { atom, createStore } from 'jotai/vanilla';
|
||||
import { getWorkspace, waitForWorkspace } from './__internal__/workspace.js';
|
||||
|
||||
// global store
|
||||
export const rootStore = createStore();
|
||||
let rootStore = createStore();
|
||||
|
||||
export function getCurrentStore() {
|
||||
return rootStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal do not use this function unless you know what you are doing
|
||||
*/
|
||||
export function _setCurrentStore(store: ReturnType<typeof createStore>) {
|
||||
rootStore = store;
|
||||
}
|
||||
|
||||
export const loadedPluginNameAtom = atom<string[]>([]);
|
||||
|
||||
export const currentWorkspaceIdAtom = atom<string | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user