-
Notifications
You must be signed in to change notification settings - Fork 94
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
Surface status code in state #319
Comments
Here's an example: generalpiston@b8e3f57. |
Added PR: #320 |
Is there any concern about the implications of this change with non-request async functions? |
@rstire364 great point. I didn't think about it. Would it make sense to make it optional? |
This might not be a popular answer but I think it's a user-land issue. I would argue this change borders on a violation of separation of concerns. React Async is concerned with providing an abstraction around async state management. To be fair, I've used React Async exclusively with Axios, so status and statusCode are readily available. This further reinforces my thought that this is a request library responsibility and not React Async's. |
To your point @rstire364 . I could have also just made |
Certainly a valid |
Let's close this then. Thanks @rstire364 |
Status codes are useful for front end state management. For example, an API that return 403 and 401 can be treated differently. Also, sometimes APIs return 202 for async processing.
The text was updated successfully, but these errors were encountered: