Skip to content

Instantly share code, notes, and snippets.

@coffee-cup
Created October 23, 2019 12:46
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/5f178f889485e2226d968fe49e09dfe9 to your computer and use it in GitHub Desktop.
Save coffee-cup/5f178f889485e2226d968fe49e09dfe9 to your computer and use it in GitHub Desktop.
import { Action } from './overmind'
export const noArgAction: Action = (context, value) => {
value // this becomes "void"
}
export const argAction: Action<string> = (context, value) => {
value // this becomes "string"
}
export const noArgWithReturnTypeAction: Action<void, string> = (context, value) => {
value // this becomes "void"
return 'foo'
}
export const argWithReturnTypeAction: Action<string, string> = (context, value) => {
value // this becomes "string"
return value + '!!!'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment