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.

⚛ Atom #

pub package ci coverage License: MIT

⚠️ Status: Experimental

Reactive primitives for Dart.

Inspired by Signals and Runes.

Quick Start #

import 'package:atom/atom.dart';

void main() {
  // Create reactive values called atoms.
  final x = atom(0);
  final y = atom(1);

  // Sum will be recomputed whenever either x or y change.
  final sum = computed(() => x() + y());

  // The effect will run whenever either x, y, or sum change.
  effect(() => print('${x()} + ${y()} = ${sum()}'));

  // Increment the value of x by 1.
  x.update((value) => value + 1);

  // Set the value of y to 42;
  y.set(42);
}
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