get_event_bus 1.0.0 get_event_bus: ^1.0.0 copied to clipboard
A minimal and scalable light-weight event bus library for get.dart
get_event_bus.dart #
A minimal and scalable light-weight event bus library for get.dart
Quick Start #
No setup needed.
void main() {
// fire a event
Get.bus.fire(SomeClass());
// listen a event
Get.bus.on<SomeClass>((event) => Get.log(event), cancelOnError: true);
// listen a event for once
Get.bus.once<SomeClass>((event) => Get.log(event));
// direct use of stream
Get.bus.stream.listen((event) => Get.log(event), onData() => Get.log('onData'));
// customized underlying stream
Get.bus.streamController = PublishSubject();
// independent use
final bus = EventBus();
}
Feature #
- Minimal and scalable
- Support get.dart
- Support all platforms
- 100% test coverage
Maintenance #
- Maintaining
- Stable API