Closed tarim closed 7 years ago
The usage example in the README is with combineReducers
.
Hi @noseglid ,
I see that, but, it is not clear. ok, you added it to your reducer list, and use combineReducers to build your reducer. after how do you dispatch it? or how do you add it it your actions?
Thanks,
for example I have a function for call api and get user details and dispatch them to redux store export function getUser() { return function(dispatch){ axios.get('/api/v1/Account/Get/User').then(response=>{ dispatch(getUserSuccess(response)); });
}
}
and action is
export function getUserSuccess(response) { return{type:types.GET_USER,payload:response}; }
and User reducer is
import * as types from '../actions/actionTypes';
const INITIAL_STATE = { all: [] };
export default function(state = INITIAL_STATE, action) { switch (action.type) { case types.GET_USER: return {...state,all:action.payload.data}; default: return state; } }
Hi there,
I try to use your spinner on my application, and, I have more than ten reducers, and I used combineReducers. So, my question is, how we use it with multi reducers?
Thanks,