Hacker News new | past | comments | ask | show | jobs | submit login

For a deep dive: https://dev.to/n1ru4l/homebrew-react-hooks-useasynceffect-or...

I think the current best answer is https://github.com/n1ru4l/use-async-effect

But as noted by your SO question, Suspense for data fetching is what we're waiting for. It was originally scheduled to be released the middle of this year but was delayed. https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#an-up...




I'd say for 95% of data fetches https://github.com/slorber/react-async-hook works really well without needing generator syntax or explicit promise cancellation boilerplate. I'm not the author but a satisfied user.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: