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

Cleanup on unmount #7

Open
namnm opened this issue Feb 12, 2020 · 2 comments
Open

Cleanup on unmount #7

namnm opened this issue Feb 12, 2020 · 2 comments

Comments

@namnm
Copy link

namnm commented Feb 12, 2020

Can we have an option to cleanup on unmount, something similar to this:

promiseCaches.push(promiseCache);

useEffect(() => () => {
  promiseCaches = promiseCaches.filter(p => p !== promiseCache);
}, []);

throw promiseCache.promise;
@AnthonyTsang
Copy link

facebook/react/issues/14563#issuecomment-453184356

when a component Suspends, we don't preserve any of its intermediate state

@msereniti
Copy link

You can use my fork of this package react-use-await.

I solved most of package issues and also provided isolated and limited caching – hope this will help you

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

3 participants