Skip to content

Instantly share code, notes, and snippets.

@jide
Created April 1, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jide/97bf083b03f7229b8126a22ef94f4e64 to your computer and use it in GitHub Desktop.
Save jide/97bf083b03f7229b8126a22ef94f4e64 to your computer and use it in GitHub Desktop.
import { createOvermind } from 'overmind';
import {
createStateHook,
createActionsHook,
createEffectsHook,
createReactionHook
} from 'overmind-react';
import { state } from './state';
import * as actions from './actions';
import { gql } from './effects/gql';
import { router } from './effects/router';
import { auth } from './effects/auth';
import { keyboard } from './effects/keyboard';
import { history } from './effects/history';
import { focus } from './effects/focus';
import { polling } from './effects/polling';
export const config = {
state,
actions,
effects: {
gql,
router,
auth,
keyboard,
history,
focus,
polling
}
};
export const useAppState = createStateHook();
export const useActions = createActionsHook();
export const useEffects = createEffectsHook();
export const useReaction = createReactionHook();
export const overmind = createOvermind(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment