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

On next, dispatches requestType rather than failureType for fetch errors #99

Closed
Andrew-Hagedorn-ZocDoc opened this issue Aug 17, 2016 · 6 comments
Labels
Milestone

Comments

@Andrew-Hagedorn-ZocDoc
Copy link

On the next branch, when there is failed request on fetch it dispatches the requestType rather than the expected failureType:

https://github.com/agraboso/redux-api-middleware/blob/next/src/middleware.js#L107

Is this the expected behavior?

@agraboso
Copy link
Owner

@Andrew-Hagedorn-ZocDoc Things are fluid right now. I hadn't touched this library in a long time and I am in the process of addressing some of the issues. In the meantime, the README might be out of date.

@Reaverart
Copy link

I'm also confused with it, how do you handle errors if it dispatches requestType?

@Reaverart
Copy link

@agraboso Sorry for nagging, but I'm trying to understand logic at this point. Why does it dispatches "request" type instead of "failure"? There is no real http request performed in case of invalid RSAA and definitely should be failure in case of error for me..
So does your request reducer checks for error true? Or.. How do you deal with errors which dispatched with request type, is there a clean way?
I've checked sample app from "Projects using redux-api-middleware" section, but there is no reducers to handle dispatched actions and no error handling..

@Reaverart
Copy link

Reaverart commented Dec 9, 2016

Found a related discussion #44 and related pullreq #26

@nason nason added this to the 2.0.0 milestone May 17, 2017
@nason nason added the question label May 17, 2017
nason added a commit to nason/redux-api-middleware that referenced this issue Mar 3, 2018
Previously:

RSAA -> Request FSA -> Request Error FSA

Now:

RSAA -> Request FSA -> Failure FSA

Closes agraboso#26 agraboso#44 agraboso#99
@nason nason modified the milestones: 2.0.0, 3.0 Mar 3, 2018
nason added a commit that referenced this issue Mar 3, 2018
Previously:

RSAA -> Request FSA -> Request Error FSA

Now:

RSAA -> Request FSA -> Failure FSA

Closes #26 #44 #99
@nason
Copy link
Collaborator

nason commented Mar 3, 2018

Update: I'm hoping to push out #175 in a 3.0 release soon

nason added a commit that referenced this issue Jun 10, 2018
Previously:

RSAA -> Request FSA -> Request Error FSA

Now:

RSAA -> Request FSA -> Failure FSA

Closes #26 #44 #99
nason added a commit that referenced this issue Jun 10, 2018
Previously:

RSAA -> Request FSA -> Request Error FSA

Now:

RSAA -> Request FSA -> Failure FSA

Closes #26 #44 #99
@nason
Copy link
Collaborator

nason commented Jun 10, 2018

#175 was merged into the next branch (which will become the 3.0 release) and changes this behavior.

I hope to have a beta published to npm in the next few days. Closing this issue out now but feel free to re-open or continue commenting here.

@nason nason closed this as completed Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants