Skip to content

Instantly share code, notes, and snippets.

@carlrip
Last active September 20, 2019 03:21
Show Gist options
  • Save carlrip/ccfc18368813e815715d5f1a4ca90b5a to your computer and use it in GitHub Desktop.
Save carlrip/ccfc18368813e815715d5f1a4ca90b5a to your computer and use it in GitHub Desktop.
What is the type of action in the default branch?
const reducer = (state: State, action: Actions): State => {
switch (action.type) {
case "increment":
return { count: state.count + action.incrementStep };
case "decrement":
return { count: state.count - action.decrementStep };
default:
action;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment