Created
June 28, 2019 16:31
-
-
Save FreddyPoly/2effbe07a1d1677a3c35250a77a9f469 to your computer and use it in GitHub Desktop.
[REACT NATIVE] Mobx root-store Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Instance, SnapshotOut, types } from "mobx-state-tree" | |
import { NavigationStoreModel } from "../../navigation/navigation-store" | |
import { ApiStoreModel } from "../../services/api/api-store" | |
/** | |
* An RootStore model. | |
*/ | |
export const RootStoreModel = types.model("RootStore").props({ | |
navigationStore: types.optional(NavigationStoreModel, {}), | |
apiStore: types.optional(ApiStoreModel, {}), | |
}) | |
/** | |
* The RootStore instance. | |
*/ | |
export type RootStore = Instance<typeof RootStoreModel> | |
/** | |
* The data of an RootStore. | |
*/ | |
export type RootStoreSnapshot = SnapshotOut<typeof RootStoreModel> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment