-
Notifications
You must be signed in to change notification settings - Fork 5
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
Abortable requests #34
Comments
for reference rgs. react-native: facebook/react-native#18115 E: Also, this workaround might be needed: facebook/react-native#18115 (comment) |
- Works & Tested for fetch - TODO: Superagent compatibility and tests Fixes thorgate#34
- Works & Tested for fetch Fixes thorgate#34 TODO: - Superagent compatibility and tests - Check if cross-fetch provides form-data or not
Got it working with Had to swap out |
Works & Tested for fetch and superagent, both using the same external API. - Replaces isomorphic-fetch with cross-fetch since the latter is maintained. Sadly no form-data in cross-fetch so we still need to keep form-data things in our dependencies. Fixes thorgate#34
Works & Tested for fetch and superagent, both using the same external API. - Replaces isomorphic-fetch with cross-fetch since the latter is maintained. Sadly no form-data in cross-fetch so we still need to keep form-data things in our dependencies. See thorgate#34
Works & Tested for fetch and superagent, both using the same external API. - Replaces isomorphic-fetch with cross-fetch since the latter is maintained. Sadly no form-data in cross-fetch so we still need to keep form-data things in our dependencies. See thorgate#34
Superagent now also works |
Works & Tested for fetch and superagent, both using the same external API. - Replaces isomorphic-fetch with cross-fetch since the latter is maintained. Sadly no form-data in cross-fetch so we still need to keep form-data things in our dependencies. See thorgate#34
Works & Tested for fetch and superagent, both using the same external API. - Replaces isomorphic-fetch with cross-fetch since the latter is maintained. Sadly no form-data in cross-fetch so we still need to keep form-data things in our dependencies. See thorgate#34
Sad news about react-native, currently I did not manage to get aborting to work. See my testing repo here: https://github.com/Jyrno42/rn-tg-resources-tester. The following commit contains a testcase for aborting a request on react native and some explanations on what I tried to get aborting to work |
We should do a release without RN support. We should also try to advocate (or do it ourselves) the AbortController thing inside rn core. |
Released in v3.1.0 |
Some progress on react-native support - got it working with After that I would focus my efforts towards getting facebook/react-native#18115 resolved. Seemed to get it working by updating whatwg-fetch inside react-native core manually and using |
I think adding support for
Aborting requests
requires some more planning due to the differences betweenfetch
andsuperagent
in how they deal with aborting requests.In fetch one needs to provide an AbortController.signal in the arguments to the
fetch
call. The controller itself has a methodabort
which can be called to cancel the request. When a request is cancelled it's promise is rejected.However, with superagent -
abort
is a method on the request. Upon abortthe promises behaves similarly to fetch.It actually doesn't, we need to add a listener toabort
event and reject via that.Based on this, I have a couple of questions that need to get answered before we agree upon the final API for abortable requests.
saga-resource
?Progress
The text was updated successfully, but these errors were encountered: