1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 4x 4x 1x 3x 3x | import { CREATE_USER_SUCCESS, FETCH_USER_SUCCESS } from '../actionTypes' export default function usersReducer (state = [], action) { const { type } = action if (type === FETCH_USER_SUCCESS) { return [ ...state, action.result ] } Iif (type === CREATE_USER_SUCCESS) { return [ ...state, action.result ] } return state } |