Often, we will do something like this:
@riverpod
Task task(Ref ref) => getTask();
@riverpod
String taskName(Ref ref) => ref.watch(taskProvider).name;
This is great, but now if i wanted to invalidate or refresh taskNameProvider to get the latest value, it doesn't actually do anything, since we needed to invalidate/refresh taskProvider instead.
This request is to define some kind of invalidation forwarding. perhaps something like
@riverpod
String taskName(Ref ref) {
ref.forwardInvalidation(taskProvider);
return ref.watch(taskProvider).name;
}
which will decrease the overhead on callers, such that they no longer need to know the implementation
the only thing I can think of otherwise would be to do something like ref.onDispose(() => ref.invalidate(taskProvider)) but that doesn't actually work, since taskNameProvider could dispose for other reasons.
Often, we will do something like this:
This is great, but now if i wanted to invalidate or refresh
taskNameProviderto get the latest value, it doesn't actually do anything, since we needed to invalidate/refreshtaskProviderinstead.This request is to define some kind of invalidation forwarding. perhaps something like
which will decrease the overhead on callers, such that they no longer need to know the implementation
the only thing I can think of otherwise would be to do something like
ref.onDispose(() => ref.invalidate(taskProvider))but that doesn't actually work, sincetaskNameProvidercould dispose for other reasons.