preact_signals
7.0.0, released 6 months ago by rodydavis.com
Dart port of Preact.js Signals for fine-grained reactive state management.
WASM-ready
What it does
Provides core reactive primitives like signals, computed values, and effects for managing application state. Automatically tracks dependencies and updates UI or business logic precisely without manual listeners.
AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want fine-grained reactivity without boilerplate.
- You prefer signals over traditional widget-tree state management.
- You are porting or matching an architecture that uses Preact signals.
Skip it when
- Your project standardizes entirely around Riverpod, Bloc, or Provider.
- You want automatic widget-tree rebuilding integrated directly out of the box without additional bindings.
Strengths
- Fine-grained updates without rebuilding entire widget subtrees
- Zero codegen required
- Direct Dart port of a mature and proven JS signals library
Weaknesses
- Relatively niche ecosystem in Flutter compared to Riverpod or Bloc
- Not documented with explicit built-in Flutter widget binding helpers in the provided text
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
not documented
import 'package:preact_signals/preact_signals.dart';
final counter = signal(0);
void main() {
print(counter.value); // 0
counter.value = 1;
print(counter.value); // 1
}Alternatives
Packages that do the same job and could replace preact_signals.
Works with
Packages commonly used together with preact_signals: ones it builds on, ones built on it, and its own family.
- a2ui_coreBuilt on preact_signalsFramework-agnostic Dart SDK for the A2UI protocol supporting messages, data binding, and state models.
- signals_coreBuilt on preact_signalsFine-grained reactivity library for modeling state and business logic in Dart.
- bloc_signalsBuilt on preact_signalsState management library bridging BLoC semantics with signals primitives.