Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Created June 3, 2016 23:27
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 joaomilho/8d396c904e92f638b989ca49cb2ac4b4 to your computer and use it in GitHub Desktop.
Save joaomilho/8d396c904e92f638b989ca49cb2ac4b4 to your computer and use it in GitHub Desktop.
const calculatorReducer = guard({
add: (state, payload) => state + payload],
subtract: (state, payload) => state - payload],
multiply: (state, payload) => state * payload],
divide: (state, payload) => state / payload],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment