Sha256: c74acf02fc70ace4ddb385c42bb9fbef675422f96392649ba4f9ce8ac900c58f

Contents?: true

Size: 332 Bytes

Versions: 3

Compression:

Stored size: 332 Bytes

Contents

import * as types from '../constants/ActionTypes'

export default function(state = 0, action) {
  switch (action.type) {
    case types.CHANGE_COUNTER:
      return action.counter
    case types.INCREMENT_COUNTER:
      return state + 1
    case types.DECREMENT_COUNTER:
      return state - 1
    default:
      return state
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bouquet-0.2.2 store/private/static/app/reducers/counter.js
bouquet-0.2.1 store/private/static/app/reducers/counter.js
bouquet-0.2.0 store/private/static/app/reducers/counter.js