oref 0.5.0 copy "oref: ^0.5.0" to clipboard
oref: ^0.5.0 copied to clipboard

discontinuedreplaced by: alien_signals

Oref is a lightweight, high-performance reactive programming library.

example/main.dart

import 'package:oref/oref.dart';

void main() {
  final count = ref(0);
  final double = derived(() => count.value * 2);
  final runner = effect(() {
    print('count: ${count.value}, double: ${double.value}');
  }, onStop: () {
    print('effect stopped');
  });

  count.value = 10; // prints 'count: 10, double: 20'
  runner.effect.stop(); // prints 'effect stopped'

  count.value = 20; // nothing

  // Has stopped, but can be manually executed through runner
  runner(); // Call once, prints 'count: 20, double: 40'

  count.value = 30; // nothing
}
1
likes
150
points
81
downloads

Publisher

verified publisherodroe.dev

Weekly Downloads

Oref is a lightweight, high-performance reactive programming library.

Homepage
Repository (GitHub)
View/report issues

Topics

#state #reactive #ref #derived #effect

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

More

Packages that depend on oref