We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My code works with axiosMiddleware, but after I switched over to multiclent, everything went wrong. It keep on giving me
Cannot read property 'request' of undefined
It seems like it's not getting the request from the redux action in payload.
import {multiClientMiddleware} from 'redux-axios-middleware'; export default ReduxStore = createStore( rootReducer, applyMiddleware( multiClientMiddleware( AxiosClient ) ) ) AxiosClient = { default: { client: axios.create({ baseURL: baseUrl, timeout: 6000, responseType: 'json', }) options: defaultConfig }, googleMaps: { client: axios.create({ baseURL: baseGoogleMapAPI, timeout: 6000, responseType: 'json' }) } } const defaultConfig = { interceptors: { request: [{ success: function ({getState, dispatch, getSourceAction}, req) { handleTokenAuth(req); }, error: function ({getState, dispatch, getSourceAction}, error) { Promise.reject(error) } } ], response: [{ success: function ({getState, dispatch, getSourceAction}, req) { handleAxiosSuccess(req); }, error: function ({getState, dispatch, getSourceAction}, error) { handleAxiosError(error); } } ] } }
Redux action, it pretty much dies here
export function getUser(){ return { type: "GET_USER", payload: { client: 'default', request: { method: 'GET', url: '/auth/user' } } }; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
My code works with axiosMiddleware, but after I switched over to multiclent, everything went wrong. It keep on giving me
It seems like it's not getting the request from the redux action in payload.
Redux action, it pretty much dies here
The text was updated successfully, but these errors were encountered: