-
Notifications
You must be signed in to change notification settings - Fork 25
Feat/useFetchye-force-initial-fetch #98
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
Conversation
|
@Sam2303 change makes sense, but I worry the communication here is confusing. the |
@Matthew-Mallimo that makes sense! Wonder if something like |
I took some time to think about it, and to me |
* feat(useFetchye): forceFetch * feat(readme): forceFetch * feat(option): forceInitialFetch
Description
add an option to the
useFetchyecalledforceInitialFetchto allow the consumer to ignore the cached value.Motivation and Context
I have run into multiple occasions where I want to use this hook but sometimes want to ignore the cached value from a previous request.
flow:
useFetchyehook is present and gets the initial data from the serverwithout some code like:
instead we could just do something like
it completely negates the need for the useEffect
How Has This Been Tested?
unit test added
Types of Changes
Checklist:
What is the Impact to Developers Using Fetchye?
no breaking change but the new option to forceInitialFetch data