@laffed/rn-ts-overmind-template
Version:
React Native Expo Template using Typescript and Overmind
23 lines (18 loc) • 482 B
text/typescript
import {IContext} from 'overmind';
import {
createStateHook,
createActionsHook,
} from 'overmind-react'
import {namespaced, } from 'overmind/config'
import * as app from './app';
import * as user from './user';
export const config = namespaced({
app,
user,
});
export type Context = IContext<{
state: typeof config.state,
actions: typeof config.actions,
}>
export const useAppState = createStateHook<Context>()
export const useActions = createActionsHook<Context>()