svrcekmichal / redux-axios-middleware

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

Middleware options doesn't seems to work #77

Closed rmariuzzo closed 6 years ago

rmariuzzo commented 6 years ago

I have the following code.

import axios from 'axios'
import axiosMiddleware from 'redux-axios-middleware'

const client = axios.create({
  baseURL: 'http://api.dev',
  responseType: 'json'
})

const options = {
  successSuffix: 'success',
  errorFix: 'error'
}

export default axiosMiddleware(client, options)

When I dispatch an action as { type: 'load' } then I get { type: 'load_FAIL' }. I expected to get { type: 'load_error' }.

rmariuzzo commented 6 years ago

Just found the typo: errorFix should be errorSuffix.