JozzBus class abstract
An interface for publishing and subscribing to domain events.
This interface defines the contract for event bus implementations, allowing for dependency injection and mocking in tests.
- Implementers
- Available extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
autoListen<
T extends JozzEvent> (JozzLifecycleMixin lifecycleOwner, void onData(T)) → JozzBusSubscription< T> -
Available on JozzBus, provided by the JozzBusExtensions extension
Listen to an event and auto-register its subscription with a lifecycle-aware object. -
emit(
JozzEvent event) → void - Emits event to all subscribers.
-
emitEvent(
JozzEvent event) → JozzBus -
Available on JozzBus, provided by the JozzBusExtensions extension
Convenience method to emit events with a fluent API. -
listen<
T extends JozzEvent> (void onData(T)) → JozzBusSubscription< T> -
Available on JozzBus, provided by the JozzBusExtensions extension
Creates a subscription to events of type T. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T extends JozzEvent> () → Stream< T> - Returns a stream of domain events of type T.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited