import * as types from "../constants/ActionTypes"; import initialState from "../initialState"; export default (state = initialState.posts, { payload, type }) => { switch (type) { case types.GET_POSTS: { return { ...state, data: payload }; } case types.GET_POST: { return { ...state, onePost: payload }; } // case R: { // return {...state, isFetching: true } // } // case RS: { // return {...state, isFetching: false } // } // case RF: { // return {...state, isFetching: false } // } default: return state; } };