-
Notifications
You must be signed in to change notification settings - Fork 94
BUGFIX: Fix handleReject #47
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
BUGFIX: Fix handleReject #47
Conversation
By simply returning the error it changed the promise chain from rejected to resolved which was causing me issues.
Sorry, I don't know what busted or have time ATM to fix it 😬 If you have a second to get this fix released (even if you treat this as a bug report rather than a PR and push the fix yourself that's fine) that would be wonderful. |
Thanks for your feedback and trying to provide a fix along with it! This was originally done explicitly for compatibility with React Final Form (which expects a resolved promise). I'm on board with the change, as I don't want to break the Promise contract by not re-throwing. I do want to tread carefully when dealing with a breaking API change like this, so it won't be a quick fix. There's tests failing that I need to fix. Also the Async component API needs to be changed in tandem. |
Understood. I'll publish a temporary fork for my workshop then. Thanks for getting back to me so quickly! Pretty weird that Final Form expects a resolved promise. Should be easy for people who are using that lib to change it from rejected to resolved themselves 👍 |
Merged it to a separate branch. Will handle it from here 👍 |
Hey @ghengeveld, actually if you could do me another huge favor I would be super appreciative. Could you publish this change as a beta release? For my workshop, I'd much rather have people Even if the dist tag is something weird, that'd just make things nicer for me and the attendees if that's ok :) |
Sure, I'll get you a pre-release shortly. |
You're the best! Thanks! |
Actually this involves a bit more work, as re-throwing will cause an uncaught promise rejection in the Anyway, you can install |
Ok, sounds good. Thank you so much for giving me some of your time today @ghengeveld! And I love react-async 💯 |
No problem! Good luck with your workshop.
|
Hi, can I help somehow to get this over the line? |
@Tomino2112 Yeah, please do! Here's what has to happen:
|
@all-contributors please add @kentcdodds for code |
I've put up a pull request to add @kentcdodds! 🎉 |
Description
By simply returning the error it changed the promise chain from rejected to resolved which was causing me issues.
Breaking changes
Does this include any (potentially) breaking API changes?
Only if people were relying on the bug.
Checklist
Make sure you check all the boxes. You can omit items that are not applicable.
<Async>
anduseAsync()