onValue method

  1. @override
void onValue(
  1. Memo<T, A> memo,
  2. A arg,
  3. T value,
  4. bool fromCache,
)
override

It's called after the memoized function has completed its execution.

Implementation

@override
void onValue(Memo<T, A> memo, A arg, T value, bool fromCache) {
  if (!fromCache && value is Future) {
    value.catchError((_) {
      memo.remove(arg);
    });
  }
}