ever_cache 0.0.8 copy "ever_cache: ^0.0.8" to clipboard
ever_cache: ^0.0.8 copied to clipboard

Allows to cache a computed value for a specific duration.

example/ever_cache_example.dart

// ignore_for_file: avoid_print

import 'package:ever_cache/ever_cache.dart';

void main() {
  final cache = EverCache<String>(
    () async {
      await Future.delayed(const Duration(seconds: 1));
      return 'test';
    },
    placeholder: () => 'placeholder',
    events: EverEvents(
      onComputing: () => print('Computing...'),
      onComputed: () => print('Computed!'),
    ),
    earlyCompute: true,
  );

  print(cache.value);
}
2
likes
160
points
26
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

Allows to cache a computed value for a specific duration.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on ever_cache