text: // ------------------------------------
  // Constants
  // ------------------------------------
  export const COUNTER_INCREMENT = 'COUNTER_INCREMENT';
  export const COUNTER_HALVE = 'COUNTER_HALVE';
  
  // ------------------------------------
  // Actions
  // ------------------------------------
  export function increment (value = 1) {
    return {
      type: COUNTER_INCREMENT,
      payload: value
    }
  }
  
  export function halve () {
    return {
      type: COUNTER_HALVE
    }
  }
  
  export const actions = {
    increment,
    halve
  }
  
  // ------------------------------------
  // Action Handlers
  // ------------------------------------
  const ACTION_HANDLERS = {
    [COUNTER_INCREMENT]: (state, action) => state + action.payload,
    [COUNTER_HALVE]: (state, action) => state / 2
  }
  
  // ------------------------------------
  // Reducer
  // ------------------------------------
  const initialState = 0
  export default function counterReducer (state = initialState, action) {
    const handler = ACTION_HANDLERS[action.type]
    return handler ? handler(state, action) : state
  }
  