Interface IReadOnlyEventBus
Interface allows to subscribe and unsubscribe from event bus events. But hides and ability to dispatch an event.
Namespace: StansAssets.Foundation.Patterns
Assembly: cs.temp.dll.dll
Syntax
public interface IReadOnlyEventBus
Methods
Subscribe<T>(Action<T>)
Subscribes listener to a certain event type.
Declaration
void Subscribe<T>(Action<T> listener)
where T : IEvent
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | listener | Listener instance. |
Type Parameters
Name | Description |
---|---|
T | An event type to subscribe for. |
Unsubscribe<T>(Action<T>)
Unsubscribes listener to a certain event type.
Declaration
void Unsubscribe<T>(Action<T> listener)
where T : IEvent
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | listener | Listener instance. |
Type Parameters
Name | Description |
---|---|
T | An event type to unsubscribe for. |