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

Project maintenance and future of data fetching #64

Open
Alxblsk opened this issue Feb 1, 2022 · 3 comments
Open

Project maintenance and future of data fetching #64

Alxblsk opened this issue Feb 1, 2022 · 3 comments

Comments

@Alxblsk
Copy link

Alxblsk commented Feb 1, 2022

This is not an issue, but a topic for discussion. I noticed, that there is a message about the future of the repo.

Quote:

The approach this project takes is so-called useEffect chaining, which will not be a best practice in the future versions of React.

Is this a reference to Suspense, or it's a reference to some other way of fetching data I am not aware of?

@dai-shi
Copy link
Owner

dai-shi commented Feb 1, 2022

You are welcome to open a discussion!
Yes, it means React Suspense. But, the useEffect chaining pattern is not tied to it. Basically, useEffect is delayed and slow, so we want to avoid using it.
The best practice before Suspense comes is to start a single async function in a callback.

This means, in this library, if you use only one useAsyncTask and task.start, it's fine and it follows the best practice. Using some of useAsyncCombine* will (intentionally) cause useEffect chains.

While this project is no longer maintained, I will continue my work on data fetching hooks. My plan is to revisit https://github.com/dai-shi/react-hooks-fetch work and eventually make it v1.

@Alxblsk
Copy link
Author

Alxblsk commented Feb 3, 2022

Thank you for explanation and references, @dai-shi.
I think it might be a decent Idea to reference this issue in that message so people can find more details about the future of data fetching in context of your hooks.

@dai-shi
Copy link
Owner

dai-shi commented Feb 3, 2022

Sure, will do.

dai-shi added a commit that referenced this issue Feb 3, 2022
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

No branches or pull requests

2 participants