[fetch-driver-interceptor: onSuccess] should we return Response or body?
See original GitHub issueI am trying to use interceptor, but I have discovered that returning Response
object in onSuccess
doesn’t seem to be useful as I can’t .json
my response as Response
can only read once. Do you think we should return the Response body
to onSuccess
instead?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Should a RESTful 'PUT' operation return something....
@systemPAUSE Nice answer. One small point: if you are not going to be returning a response body to a successful operation, I would...
Read more >RESTful API. Should I be returning the object that was created ...
8 Answers 8 · It is OK (and most likely desirable) to return something in a POST/PUT response body. · How this is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@leesiongchan Since new relese of Fetch driver, you could read
response.data
instead ofresponse.json()
- https://github.com/klis87/redux-saga-requests/releases/tag/redux-saga-requests-fetch%400.7.0Writing in case you still need it.
Can u give an example? As maybe this is really not to be placed inside interceptor? Interceptors should be used only really for global stuff. What you can do for example is to create new saga:
In the same way you can add dozens of other sagas, waiting for success, error, abort, request actions of any type/types. Will it solve your use case?