Skip to content

Instantly share code, notes, and snippets.

@coffee-cup
Created October 23, 2019 12:45
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 coffee-cup/5e3ddb0cadf6e34138f24a0b9f12dd33 to your computer and use it in GitHub Desktop.
Save coffee-cup/5e3ddb0cadf6e34138f24a0b9f12dd33 to your computer and use it in GitHub Desktop.
// src/overmind/index.ts
import {
IConfig,
IOnInitialize,
IAction,
IOperator,
IDerive,
IState
} from 'overmind'
export const config = {
state: { /* ... */ },
actions: { /* ... */ }
}
export interface Config extends IConfig<typeof config> {}
export interface OnInitialize extends IOnInitialize<Config> {}
export interface Action<Input = void, Output = void> extends IAction<Config, Input, Output> {}
export interface AsyncAction<Input = void, Output = void> extends IAction<Config, Input, Promise<Output>> {}
export interface Operator<Input = void, Output = Input> extends IOperator<Config, Input, Output> {}
export interface Derive<Parent extends IState, Output> extends IDerive<Config, Parent, Output> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment