組み合わせReducerもそうすることができます



const rootReducer = combineReducers({
  index: (state = {}, action) => {
    switch (action.type) {
      case HYDRATE:
        return { ...state, ...action.payload };
      default:
        return state;
    }
  },
  user,
  post,
});

//위의 코드를 아래처럼 바꿀 수 있다.

const rootReducer = (state, action) => {
  switch (action.type) {
    case HYDRATE : 
      return action.payload;
    default: {
      const combinedReducer = combineReducers({
        user,
        post,
      });
      return combinedReducer(state, action);
    }
  }
};
このように動作します.

こうなります.△これはいい変化です.