remember<T> method

Future<T> remember<T>(
  1. String key,
  2. Duration? duration,
  3. FutureOr<T> compute()
)

The cached value, or run compute and store the result.

List<dynamic> posts = await Cache().remember('posts',
  Duration(minutes: 5), () => Post().all());

Implementation

Future<T> remember<T>(
  String key,
  Duration? duration,
  FutureOr<T> Function() compute,
) {
  return repository.remember<T>(key, duration, compute);
}