svrcekmichal / redux-axios-middleware

Redux middleware for fetching data with axios HTTP client
MIT License
920 stars 96 forks source link

Wrong parameters multiClientMiddleware #76

Open AthanasiosKoumpouras opened 6 years ago

AthanasiosKoumpouras commented 6 years ago

This is happening when you try to use more than one client.

I have tried everything (How to structure the config for multiple clients). using version ^4.0.0

//My current config
import axios from 'axios';
const clients = {
    ['default']: {
        client: axios.create({
            baseURL: 'http://foo/',
            responseType: 'json',
        }),
        options: {
            interceptors: {
                request: [
                    (store, config) => {
                        return config
                    }
                ]
            }
        }
    },
    ['bar']: {
        client: axios.create({
            baseURL: '/bar',
            responseType: 'json',
        }),
        options: {
            interceptors: {
                request: [
                    (store, config) => {
                        return config
                    }
                ],
                response: [
                    (store, response) => {
                        return response
                    }
                ]
            }
        }
    }
}

export default clients;
AthanasiosKoumpouras commented 6 years ago

Any comment on this?

vasilevich commented 5 years ago

@AthanasiosKoumpouras Sorry, I don't understand the purpose of this PR, can you please explain in more detail?

Thanks.