bloc_signals
1.8.0, released today by blocsignal.dev
State management library bridging BLoC semantics with signals primitives.
WASM-ready
What it does
Bridges the Business Logic Component (BLoC) pattern with reactive signals primitives to provide synchronous state management. It features event concurrency transformers, VM Service telemetry, and stream interop extensions.
AI-written summary of version 1.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want BLoC-style architecture with synchronous state propagation.
- You need fine-grained reactive updates using signals primitives.
- You require event concurrency transformers like Mutex, droppable, or sequential.
Skip it when
- You prefer the standard asynchronous Stream-based bloc package.
- You are using a completely different state management approach like Riverpod or Provider.
Strengths
- Synchronous state propagation without microtask delays.
- Streamless event concurrency transformers.
- Built-in DevTools telemetry and observer support.
Weaknesses
- Adds an extra conceptual layer combining signals and BLoC semantics.
- Requires adherence to its specific synchronous lifecycle contract.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add bloc_signals to dependencies in pubspec.yaml.
import 'package:bloc_signals/bloc_signals.dart';
class CounterCubit extends CubitSignal<int> {
CounterCubit() : super(initialState: 0);
void increment() => emit(stateValue + 1);
void decrement() => emit(stateValue - 1);
}Alternatives
Packages that do the same job and could replace bloc_signals.
Works with
Packages commonly used together with bloc_signals: ones it builds on, ones built on it, and its own family.
- preact_signalsbloc_signals depends on itDart port of Preact.js Signals for fine-grained reactive state management.
- signals_corebloc_signals depends on itFine-grained reactivity library for modeling state and business logic in Dart.
- bloc_signals_flutterBuilt on bloc_signalsFlutter UI extensions, providers, and bindings for the bloc_signals state management library.