alien_signals 2.4.0
alien_signals: ^2.4.0 copied to clipboard
Alien Signals is a reactive state management library that brings the power of signals to Dart and Flutter applications.
ð Get Started Today! #
import 'package:alien_signals/alien_signals.dart';
void main() {
final count = signal(0);
final doubled = computed((_) => count() * 2);
final stop = effect(() {
print('Count: ${count()}, Doubled: ${doubled()}');
}); // Count: 0, Doubled: 0
count.set(1); // Count: 1, Doubled: 2
stop();
count.set(2); // The stopped effect no longer runs.
}
Run the complete example with dart run example/main.dart.
ð What is Alien Signals? #
Alien Signals is a reactive core for Dart built around a generic
ReactiveSystem. It includes a high-performance signals preset and a small,
ergonomic surface API. Inspired by
StackBlitz's alien-signals, the
Dart implementation provides:
- ðŠķ Ultra Lightweight: Minimal overhead, maximum efficiency
- ðŊ Simple API: Intuitive
signal(),computed(), andeffect()functions - ð§ Production Ready: Battle-tested through comprehensive beta releases
ð§ Core Layers #
- System: A reusable reactive graph and propagation engine (
system). - Preset: A complete signals implementation on top of the system (
preset). - Surface API: Convenience
signal/computed/effectwrappers built on the preset.
ð Key Features #
- Lazy Computed Values: Cache derived state until dependencies change
- Effect Cleanup: Release resources before re-running and on disposal
- Effect Scopes: Group effects and nested scopes under one disposal handle
- Batch Operations: Defer effects while applying multiple writes
- Flexible API: Use the surface directly or customize the preset and system
See the runnable recipes for each feature.
ðĶ Installation #
Requires Dart 3.13 or later.
dart pub add alien_signals
ð Documentation #
- Guide: Layers (system/preset/surface) and core concepts. See docs/guide.md.
- API Reference: Generated documentation for all three public libraries. See docs/api.md.
- Recipes: Runnable examples, lifecycle rules, and common pitfalls. See docs/recipes.md.
AI agent skill #
From your project, install the bundled alien-signals-reactivity skill to help
your coding agent write reactive code, debug missed updates and cleanup, and
build libraries on Alien Signals:
dart run skills@ get -p alien_signals
Select your coding agent when prompted. Try asking it to:
- Find why a signal update does not reach an effect.
- Add a reactive search that ignores outdated responses and stops on disposal.
- Build a
.valuewrapper while preserving tracking and cleanup.
ð Community & Ecosystem #
Adoptions #
- Solidart - Signals for Flutter inspired by SolidJS
- Oref - Magical reactive state management for Flutter
- flutter_compositions - Vue-inspired reactive building blocks for Flutter
- ZenBus - A high-performance, flexible event bus for Flutter applications
- ZenSignals - Signal-based state bridging Flutter's ValueNotifier and ValueListenable APIs
- alien_signals_translator - Reactive JSON-based localization with ICU message formatting for Flutter
- signal_router - Signal-based routing and navigation state for Dart and Flutter (alpha)
Growing Ecosystem #
Join our thriving community of developers building reactive applications with Alien Signals!
ð Resources #
- API Documentation - Complete API reference
- Examples - Code examples and demos
- Migration Guide - Upgrade instructions