How to use overmind-react - 9 common examples

To help you get started, we’ve selected a few overmind-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / next.js / examples / with-overmind / overmind / index.js View on Github external
switch (state.page) {
        case 'Index':
          // Do some additional logic
          break
        case 'About':
          // Do some additional logic
          break
        default:
          break
      }
    },
  },
}

export const useOvermind = createHook()
github cerebral / overmind / packages / demos / react-typescript-todomvc / src / app / index.ts View on Github external
import * as actions from './actions'
import * as context from './context'
import * as state from './state'

const config = {
  context,
  actions,
  state,
}

const app = new App(config)

export type Connect = TConnect

export const connect = createConnect(app)

type IApp = TApp

export default app

// ==== The following types are copied from overmind documentation ====

export type Action = TAction<
  IApp,
  Value,
  ReturnValue
>

export type Mutate = TMutate

export type Context = TContext
github SaraVieira / svg-to-jsx-electron / src / overmind / index.js View on Github external
state.jsCode = prettier.format(transformedCode, state.prettier)
    },
    async submitForm({ state }) {
      const svgoCode = await svgo(state.svgCode.trim())
      const code = await svgr(svgoCode, state, {
        componentName: state.name
      })
      state.jsCode = prettier.format(code, state.prettier)
    }
  },
  effects: {
    persistedState
  }
}

export const useOvermind = createHook()
github cerebral / overmind / packages / overmind-website / src / overmind / index.ts View on Github external
effects,
  },
  namespaced({
    foo: {
      actions: {
        foo: () => {},
      },
    },
  })
)

declare module 'overmind' {
  interface Config extends IConfig {}
}

export const useOvermind = createHook()
github cerebral / overmind / packages / demos / react-todomvc / src / app / index.js View on Github external
},
    addTodo({ value: event, state }) {
      event.preventDefault()
      state.todos.unshift({
        title: state.newTodoTitle,
        completed: false,
      })
      state.newTodoTitle = ''
    },
    toggleCompleted({ value: todo }) {
      todo.completed = !todo.completed
    },
  },
})

export const useOvermind = createHook(app)

export default app
github nscozzaro / physics-is-beautiful / courses / static / courses / js / containers / StudioViews / EditorsViews / containers / LessonWorkSpace / Codesandbox / app / overmind / index.ts View on Github external
export interface Action<input>
  extends IAction {}

export interface AsyncAction<input>
  extends IAction&gt; {}

export interface Operator<input>
  extends IOperator {}

export interface Derive
  extends IDerive {}

export const connect = createConnect();

export const useOvermind = createHook();
github cerebral / overmind / packages / node_modules / overmind-devtools-client / src / overmind / index.ts View on Github external
import * as effects from './effects'
import onInitialize from './onInitialize'
import state from './state'

export const config = {
  onInitialize,
  effects,
  actions,
  state,
}

declare module 'overmind' {
  interface Config extends IConfig {}
}

export const useOvermind = createHook()
github SurenAt93 / monaco-react / demo / src / store / index.js View on Github external
import { createOvermind } from 'overmind';
import { createHook } from 'overmind-react';

import { initialState } from './state';
import * as actions from './actions';
import * as effects from './effects';

export const store = createOvermind({
  state: initialState,
  actions,
  effects,
});

export const useStore = createHook();
github codesandbox / codesandbox-client / packages / app / src / app / overmind / index.ts View on Github external
export interface Action<input>
  extends IAction {}

export interface AsyncAction<input>
  extends IAction&gt; {}

export interface Operator<input>
  extends IOperator {}

export interface Derive
  extends IDerive {}

export const connect = createConnect();

export const useOvermind = createHook();

overmind-react

Functional actions

MIT
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis

Popular overmind-react functions