diff options
Diffstat (limited to 'app/models/root-store/setup-root-store.ts')
-rw-r--r-- | app/models/root-store/setup-root-store.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/models/root-store/setup-root-store.ts b/app/models/root-store/setup-root-store.ts index 4a6d0c5..b1a741b 100644 --- a/app/models/root-store/setup-root-store.ts +++ b/app/models/root-store/setup-root-store.ts @@ -1,12 +1,12 @@ -import { onSnapshot } from "mobx-state-tree" -import { RootStoreModel, RootStore } from "./root-store" -import { Environment } from "../environment" -import * as storage from "../../utils/storage" +import { onSnapshot } from 'mobx-state-tree' +import { RootStoreModel, RootStore } from './root-store' +import { Environment } from '../environment' +import * as storage from '../../utils/storage' /** * The key we'll be saving our state as within async storage. */ -const ROOT_STATE_STORAGE_KEY = "root" +const ROOT_STATE_STORAGE_KEY = 'root' /** * Setup the environment that all the models will be sharing. @@ -49,7 +49,9 @@ export async function setupRootStore() { } // track changes & save to storage - onSnapshot(rootStore, (snapshot) => storage.save(ROOT_STATE_STORAGE_KEY, snapshot)) + onSnapshot(rootStore, (snapshot) => + storage.save(ROOT_STATE_STORAGE_KEY, snapshot), + ) return rootStore } |