-
-
Notifications
You must be signed in to change notification settings - Fork 920
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
beforeDispose or beforeInvalidate hook, happen before invalidate #3570
Comments
Could you be more specific? I don't really understand the problem, not what is suggested here. Some examples of the problem and the suggestion would be great. |
so in this case
This could be useful in some other usecases I think |
I'm sceptical about this. If the provider was invalidated, to me it should rebuild immediately the next time it is used. To be, it sounds like you want to do: //in other function somewhere esle
void updatedata()async{
await Future.delayed(const Duration(seconds: 1));
ref.invalidate(getProvider)
} |
In fact, the fact that you need this delay is weird to me. Your server should be up-to-date. If it isn't, that means you didn't |
yeah some time the request sent too fast and server still cache I think.
This works most of the time. but Sometimes in the UI |
when invalidate a Future provider (that gets data) after updating remote data. The request happens so fast that sometimes get request returns not updated data.
It would be nice if there is a hook before dispose or invalidate, that I can add a wait time before the provider invalidates to ensure the data getting back is updated
The text was updated successfully, but these errors were encountered: