3-7-정규화된-데이터-업데이트
일반적인 접근
간단한 병합
import merge from "lodash/merge";
function commentsById(state = {}, action) {
switch(action.type) {
default : {
if(action.entities && action.entities.comments) {
return merge({}, state, action.entities.comments.byId);
}
return state;
}
}
}슬라이스 리듀서 구성
Last updated
Was this helpful?