Add auth navigations
This commit is contained in:
parent
fc3b2952bb
commit
802222fe71
11 changed files with 129 additions and 25 deletions
|
@ -4,12 +4,21 @@
|
|||
|
||||
import {Instance, SnapshotOut, types} from 'mobx-state-tree'
|
||||
import {createContext, useContext} from 'react'
|
||||
import {SessionModel, createDefaultSession} from './session'
|
||||
|
||||
export const RootStoreModel = types.model('RootStore').props({})
|
||||
export const RootStoreModel = types.model('RootStore').props({
|
||||
session: SessionModel,
|
||||
})
|
||||
|
||||
export interface RootStore extends Instance<typeof RootStoreModel> {}
|
||||
export interface RootStoreSnapshot extends SnapshotOut<typeof RootStoreModel> {}
|
||||
|
||||
export function createDefaultRootStore() {
|
||||
return {
|
||||
session: createDefaultSession(),
|
||||
}
|
||||
}
|
||||
|
||||
// react context & hook utilities
|
||||
const RootStoreContext = createContext<RootStore>({} as RootStore)
|
||||
export const RootStoreProvider = RootStoreContext.Provider
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue