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

feat: Add useAsync and useAsyncPerform hooks using Concurrency #4

Merged
merged 8 commits into from
Apr 17, 2022

Conversation

ra1028
Copy link
Owner

@ra1028 ra1028 commented Jun 11, 2021

No description provided.

@ra1028 ra1028 marked this pull request as draft June 11, 2021 21:45
@hfossli
Copy link

hfossli commented Jun 11, 2021

How do you trigger a retry?

@ra1028
Copy link
Owner Author

ra1028 commented Jun 12, 2021

I'm thinking of adding another hook named 'useAsyncRun' or something like that so that the async operation can be ran manually.

@hfossli
Copy link

hfossli commented Jun 12, 2021

I think useSWR nailed it https://github.com/vercel/swr

If useAsync returned an object with the value as a property you can add other useful properties and functions such as retry.

@ra1028 ra1028 force-pushed the useAsync branch 2 times, most recently from 9235775 to f06738e Compare April 12, 2022 15:14
@ra1028 ra1028 changed the title Experimentally add useAsync hook that uses Swift Concurrency API feat: Add useAsync and useAsyncPerform hooks using Concurrency Apr 12, 2022
@ra1028 ra1028 marked this pull request as ready for review April 17, 2022 15:25
@ra1028 ra1028 merged commit 4676495 into main Apr 17, 2022
@ra1028 ra1028 deleted the useAsync branch April 17, 2022 15:54
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.

2 participants