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

PR useAsyncFn callback promise rejection propagation #1755

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chomamateusz
Copy link

Description

I found an easy way to do not swallow error in useAsyncFn callback. This is potentially a breaking change, because the callback returned from hook behave differently now, but for me now it makes more sense, especially when we want to fire more side effect connect to this one (e.g. save data and if succeed move to next route).

If this breaking change can't be merged, maybe introducing a new hook with behavior described in this PR will be a way?

This fixes the issue described here #612

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as before)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint). Fix it with yarn lint:fix in case of failure.
  • Make sure types are fine (yarn lint:types).

@chomamateusz chomamateusz changed the title Pr/use async fn callback promise rejection propagation PR useAsyncFn callback promise rejection propagation Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant