Version:
7.0.0
Installation#
dart pub add signals_core
The signals_core package exposes the foundational building blocks of the entire Signals reactive framework. It is 100% platform-agnostic, zero-dependency, and can be integrated into any Dart codebaseβincluding shelf servers, database layers, command-line scripts, or serverless functions.
Key Features#
- π Signals & Computeds: Declare reactive variables and lazy, cacheable derived states.
- β‘ Effects: Trigger side effects (like saving to databases, logging, or writing to files) automatically in response to dependency changes.
-
π Advanced Collections: Built-in reactive collections including
listSignal,setSignal,mapSignal, anditerableSignal. -
π Async Bindings: Easily bind streams and futures directly to reactive states using
futureSignalandstreamSignal. -
π Undo/Redo Change Stack: Track value histories and enable instant undo/redo functionality using
changeStack.
Quick Start#
import 'package:signals_core/signals_core.dart';
void main() {
final count = signal(0);
final doubleCount = computed(() => count.value * 2);
effect(() {
print('Double count: ${doubleCount.value}');
});
count.value = 5; // Prints: Double count: 10
}
Package Contents#
Mixins