Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created November 28, 2020 22:16
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 dagda1/8e096f1f5334574ff1f20c0ccd0d49d3 to your computer and use it in GitHub Desktop.
Save dagda1/8e096f1f5334574ff1f20c0ccd0d49d3 to your computer and use it in GitHub Desktop.
const setCount = (n: number) => {
return {
type: 'SET_COUNT',
payload: n
} as const;
}
const resetCount = () => {
return {
type: 'RESET_COUNT'
} as const;
}
type CountActions = ReturnType<typeof setCount> | ReturnType<typeof resetCount>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment