svrcekmichal / redux-axios-middleware

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

meta.previousAction is not the action that generated the action in async requests #109

Closed billygl closed 5 years ago

billygl commented 5 years ago
meta: {
      previousAction: { ... } //action which triggered request
    }

If I do the following actions, ie. FETCH_LIST and in the same time another FETCH_LIST, the reducer in the second action recovers the previousAction, in the example: the first FETCH_LIST_SUCCESS information. The sequence is: 1. FETCH_LIST, 2. FETCH_LIST, 3. FETCH_LIST_SUCCESS, 4. FETCH_LIST_SUCCESS and the issue is with the 4. FETCH_LIST_SUCCESS that retrieves meta.previousAction from 3.FETCH_LIST_SUCCESS and no from 2. FETCH_LIST.

billygl commented 5 years ago

It was due an issue with my logic. Not the middleware