atom 0.0.3 copy "atom: ^0.0.3" to clipboard
atom: ^0.0.3 copied to clipboard

A library that provides composable, reactive primitives for Dart inspired by Signals and Runes.

example/main.dart

// ignore_for_file: avoid_print
import 'package:atom/atom.dart';

void main() {
  final x = atom(1);
  final y = atom(1);

  final sum = computed(() => x() + y());
  final product = computed(() => x() * y());

  effect(() => print('${x()} + ${y()} = ${sum()}'));
  effect(() => print('${x()} * ${y()} = ${product()}'));

  for (var i = 0; i < 3; i++) {
    x.update((value) => value + 1);
    y.update((value) => value + 2);
  }
}
8
likes
150
points
63
downloads

Publisher

verified publisherfelangel.dev

Weekly Downloads

A library that provides composable, reactive primitives for Dart inspired by Signals and Runes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on atom