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;
}
}