Skip to content

Instantly share code, notes, and snippets.

@vzaidman
Created December 8, 2017 13:03
Show Gist options
  • Save vzaidman/3a82311d753f9c30afa177fb6e5cfedb to your computer and use it in GitHub Desktop.
Save vzaidman/3a82311d753f9c30afa177fb6e5cfedb to your computer and use it in GitHub Desktop.
const state1 = countReducer(undefined, {TYPE: '@@redux/INIT'})
// the initial state was set in defaultState and its value is 100
// ⇒ state1 === 100
const state2 = countReducer(state1, increaseBy(100))
// ⇒ state2 === 200
const state3 = countReducer(state2, increaseBy(-500))
// ⇒ state3 === -300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment