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);
}
1
likes
150
pub points
22%
popularity

Publisher

verified publisherarunprakashg.com

Allows to cache a computed value for a specific duration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on ever_cache