Open oltsa opened 8 years ago
redux-promise
depends on flux-standard-actions
's isFSA
method which defines a standard action to have four valid keys: type, payload, error, meta. Since your promise uses the payload property (otherwise redux-promise
won't detect it), you have to stick the index into the meta
object on the action.
return {
type: ActionTypes.SOMETHING,
payload: promiseInstance,
meta: { index }
}
Aah thank you!
I bumped into a problem and i'm not sure if it's because of axios or this middleware, but when I'm trying to return an updated array of elements, I need to pass index to the reducer
either it's not detecting it or i'm doing something wrong (bets on the ladder) as with only type and payload I can hook into with with .then from the component where I dispatch the action, but with adding extra field I cannot