Skip to content

fix apiMiddleware must not return promise on actions without [CALL_API] #80

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

Closed
wants to merge 1 commit into from
Closed

Conversation

timche
Copy link

@timche timche commented May 25, 2016

Problem:
apiMiddleware returns a promise for actions without a [CALL_API] property, this can lead to unexpected behaviour and nested promises.

Solution:
Remove async from returned action function and return instead an async function after isRSAA validation.

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 2c708af on timche:fix-async into e72ac27 on agraboso:master.

@luisincrespo
Copy link

+1

@nason
Copy link
Collaborator

nason commented Jan 24, 2018

Hi @timche sorry this has sat here open for so long!

I ported this patch to the latest release of this package and opened #167

@nason nason closed this Jan 24, 2018
@eladlevy
Copy link
Contributor

eladlevy commented Feb 27, 2018

@nason I've migrated to v2 and although following the upgrading guidelines my app was broken. After several hours debugging I've stumbled upon this PR and it made all sense. I had sections of code relying that dispatch returns a promise. IMO this change should be mentioned in the Upgrading from v1.0.x section. WDYT?

eladlevy pushed a commit to eladlevy/redux-api-middleware that referenced this pull request Feb 27, 2018
apiMiddleware no longer returns a promise on actions without [RSAA] 
relates to agraboso#80
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

Successfully merging this pull request may close these issues.

5 participants