juntaki
2/22/2017 - 4:56 PM

Reduxをソースコードから理解する その1 ref: http://qiita.com/juntaki/items/d7b44fd9c2c35ea9ce24

Reduxをソースコードから理解する その1 ref: http://qiita.com/juntaki/items/d7b44fd9c2c35ea9ce24

/**
 * These are private action types reserved by Redux.
 * For any unknown actions, you must return the current state.
 * If the current state is undefined, you must return the initial state.
 * Do not reference these action types directly in your code.
 */
export const ActionTypes = {
  INIT: '@@redux/INIT'
}
const reducer = (state = initialState, action) => {
  switch (action.type) {
    case UPDATE:
      // update state
      return newState;
    default:
      return state;
  }
};