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

Avoid possible race condition while fetching #1256

Open
SanjalKatiyar opened this issue Mar 15, 2024 · 0 comments
Open

Avoid possible race condition while fetching #1256

SanjalKatiyar opened this issue Mar 15, 2024 · 0 comments

Comments

@SanjalKatiyar
Copy link
Collaborator

Refer: https://react.dev/learn/you-might-not-need-an-effect#fetching-data

We don't have such clean-ups for:
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/useK8sList.ts
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/k8s-get-hook.ts
https://github.com/red-hat-storage/odf-console/blob/master/packages/shared/src/hooks/custom-prometheus-poll/use-url-poll.ts

The way we are currently using these hooks in our repo, most probably we are safe for now as arguments passed to the dependency list of the useEffect are mostly static throughout the lifecycle of the component, but generic hooks should be agnostic of such assumptions.

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

1 participant