ever_cache 0.0.4 copy "ever_cache: ^0.0.4" to clipboard
ever_cache: ^0.0.4 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
0
points
26
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

Allows to cache a computed value for a specific duration.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on ever_cache