creator_core 0.3.3 copy "creator_core: ^0.3.3" to clipboard
creator_core: ^0.3.3 copied to clipboard

A state management library that enables concise, fluid, readable and testable business logic code.

example/main.dart

import 'package:creator_core/creator_core.dart';

final number = Creator.value(1);
final double = number.map(((n) => n * 2));
final triple = Emitter<int>(
  (ref, emit) {
    emit(ref.watch(number) * 3);
  },
);

Future<void> main(List<String> args) async {
  final ref = Ref();

  print(ref.watch(double)); // 2
  print(await ref.watch(triple)); // 3

  ref.set(number, 10);
  await Future.delayed(const Duration());
  print(ref.watch(double)); // 20
  print(await ref.watch(triple)); // 30
}
6
likes
140
points
394
downloads

Publisher

verified publisherchooly.app

Weekly Downloads

A state management library that enables concise, fluid, readable and testable business logic code.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on creator_core