DEV Community

Discussion on: Homebrew React Hooks: useAsyncEffect Or How to Handle Async Operations with useEffect

Collapse
 
pablomayobre profile image
Pablo Ariel Mayobre

This is really cool! Is this published anywhere as a package?

Also you seem to have an error in your last example, you are doing await fetch instead of yield fetch

Thanks for this piece of code, really helpful!

Collapse
 
n1ru4l profile image
Laurin Quast

Thanks 🙏 I fixed it!

I have no package published, currently I am just copy pasting it into my projects.

Collapse
 
ancientswordrage profile image
AncientSwordRage

Please do publish it

Thread Thread
 
n1ru4l profile image
Laurin Quast

Finally got around building the package with tests: github.com/n1ru4l/use-async-effect

Thread Thread
 
ancientswordrage profile image
AncientSwordRage

Thank you