zam_event_bus 0.1.0 zam_event_bus: ^0.1.0 copied to clipboard
Event bus is a event based state management package for dart.
Event Bus #
State Management Package
What's inside the package #
Includes the following core components.
Check out all the components in detail here
How to use #
final bus = EventBus([
EventTransformer(SomeEvent, (event) => SomeOtherEvent()),
EventMultiplier.direct(SomeOtherEvent, [SomeOtherEvent1(), SomeOtherEvent2()]),
]);
bus.publish(SomeEvent());
final sub = bus.select<SomeOtherEvent2>().listen(print); // Instance of 'SomeOtherEvent2'
await Future.delayed(Duration(seconds: 1));
await sub.cancel();
await bus.dispose();
To learn more, move on to the example section or check out this dedicated example in github.