Skip to main content

alien_signals 2.4.0 copy "alien_signals: ^2.4.0" to clipboard
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.

The Alien Signals mascot strolling, pausing, and sending signals.

Alien Signals on pub.dev CI status on main

🎊 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(), and effect() 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/effect wrappers 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 .value wrapper 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 #

31
likes
160
points
7.25k
downloads

Documentation

API reference

Publisher

verified publishermedz.dev

Weekly Downloads

Alien Signals is a reactive state management library that brings the power of signals to Dart and Flutter applications.

Repository (GitHub)
View/report issues

Topics

#signals #reactive #state-management

Funding

Consider supporting this project:

github.com
opencollective.com

License

MIT (license)

More

Packages that depend on alien_signals