bloc_event_transformers
2.0.0, released 2 years ago by monterail.com
Configurable event transformers for BLoC: throttle, debounce, skip, delay
WASM-ready
What it does
Provides stream-based transformers that can be applied to BLoC events to control their timing. It supports throttling, debouncing, skipping, and delaying events without custom implementation.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to limit event frequency in a BLoC
- You want to debounce rapid user input
- You need to skip a set number of events
- You want to delay event processing
Skip it when
- You are not using BLoC for state management
- You require custom event handling logic not covered by these transformers
Strengths
- Easy to integrate with existing BLoC code
- No code generation required
- Supports multiple common transformers
- MIT license
Weaknesses
- Only works with BLoC
- Limited to the four provided transformers
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
```dart
import 'package:bloc_event_transformers/bloc_event_transformers.dart';
class CounterBloc extends Bloc<CounterEvent, int> {
CounterBloc() : super(0) {
on<IncrementEvent>(
(event, emit) => emit(state + 1),
transformer: throttle(const Duration(seconds: 1)),
);
}
}
```Alternatives
Packages that do the same job and could replace bloc_event_transformers.
- snowplow_tracker
Flutter package for sending Snowplow analytics events on Android, iOS, and Web.
78Compare
Works with
Packages commonly used together with bloc_event_transformers: ones it builds on, ones built on it, and its own family.