Skip to content
New issue

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

Returns promise instead of data if more than 2 return items are specified in action #28

Open
xzilja opened this issue Feb 11, 2016 · 2 comments

Comments

@xzilja
Copy link

xzilja commented Feb 11, 2016

I'm not sure why this happens, but essentially inside my reducer I receive correct expected data when my action returns:

    return {
      type: STORY_ACTIONS.STORY_SPOTIFY_REQUEST,
      payload: request
    }

and I receive unresolved promise if I add another item to action, like so

    return {
      type: STORY_ACTIONS.STORY_SPOTIFY_REQUEST,
      index: index,
      payload: request
    }

I need to pass index, in order to know which array item to update

@ssilve1989
Copy link

I am also running into this issue.

If I comment the following like so /*if (!_fluxStandardAction.isFSA(action)) { return isPromise(action) ? action.then(dispatch) : next(action); } */

it works. This is from what I've pulled from npm, version 0.5.1. In the current repo it looks like the import for FSA has been changed to import the method directly however. That shouldn't make a difference though.

@ColadaFF
Copy link

As specified in #27
you need to return another params in the metaproperty, like:

return {
  type: ActionTypes.SOMETHING,
  payload: promiseInstance,
  meta: { index }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants