mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-26 23:02:57 +08:00
fcd43033fe
- moved `appSettingAtom` to infra since we now have different packages that depends on it. There is no better place to fit in for now - use atomEffect to sync setting changes to updater related configs to Electron side - refactored how Electron reacts to updater config changes.
16 lines
323 B
TypeScript
16 lines
323 B
TypeScript
import { createStore } from 'jotai';
|
|
|
|
// global store
|
|
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;
|
|
}
|