cubepod_state 0.1.2 copy "cubepod_state: ^0.1.2" to clipboard
cubepod_state: ^0.1.2 copied to clipboard

A core component of the CubePod Application Runtime. Provides cubepod_state functionalities.

cubepod_state #

Fine-grained reactive state for CubePod. Built on Signals — only the widgets that actually read a changed value rebuild.

What's inside #

  • StateSignal<T> — reactive value that notifies listeners on change
  • AsyncSignal<T> — signal with loading/error/data states for async ops
  • StreamSignal<T> — wraps a Stream into a reactive signal
  • Transaction — batch multiple signal changes into a single rebuild
  • FormState — reactive form with field-level validation

Install #

dependencies:
  cubepod_state: ^0.1.1

Usage #

import 'package:cubepod_state/cubepod_state.dart';

final count = StateSignal(0);

// Read
print(count.value); // 0

// Write
count.value++;

// Listen
count.listen((val) => print('count changed: $val'));

// Batch updates — only one rebuild fires
transaction(() {
  count.value = 10;
  name.value = 'Alice';
});

See cubepod for the full docs.

1
likes
0
points
362
downloads

Publisher

unverified uploader

Weekly Downloads

A core component of the CubePod Application Runtime. Provides cubepod_state functionalities.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cubepod_core

More

Packages that depend on cubepod_state