sevenLee
5/16/2016 - 7:28 AM

iframe get state issue - action and reducer

iframe get state issue - action and reducer

// [ action.js ]

    export function addTodo (attrs) {
      return {
        type: 'ADD_TODO',
        attrs
      };
    }

// [ reducer.js ]

    export default (state = {text:'', uid:''}, action) => {
      switch(action.type) {
        case 'ADD_TODO':
          return Object.assign({}, state, action.attrs);
        default:
          return state;
      }
    }