diff options
Diffstat (limited to 'app/models/root-store')
-rw-r--r-- | app/models/root-store/root-store-context.ts | 4 | ||||
-rw-r--r-- | app/models/root-store/root-store.ts | 4 | ||||
-rw-r--r-- | app/models/root-store/setup-root-store.ts | 14 |
3 files changed, 12 insertions, 10 deletions
diff --git a/app/models/root-store/root-store-context.ts b/app/models/root-store/root-store-context.ts index 537e51c..f01a35c 100644 --- a/app/models/root-store/root-store-context.ts +++ b/app/models/root-store/root-store-context.ts @@ -1,5 +1,5 @@ -import { createContext, useContext } from "react" -import { RootStore } from "./root-store" +import { createContext, useContext } from 'react' +import { RootStore } from './root-store' /** * Create a context we can use to diff --git a/app/models/root-store/root-store.ts b/app/models/root-store/root-store.ts index 1131b48..56425bc 100644 --- a/app/models/root-store/root-store.ts +++ b/app/models/root-store/root-store.ts @@ -1,5 +1,5 @@ -import { Instance, SnapshotOut, types } from "mobx-state-tree" -import { CharacterStoreModel } from "../character-store/character-store" +import { Instance, SnapshotOut, types } from 'mobx-state-tree' +import { CharacterStoreModel } from '../character-store/character-store' /** * A RootStore model. 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 } |