Class EventBus
Basic implementation of the IEventBus.
Inheritance
System.Object
EventBus
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Patterns
Assembly: cs.temp.dll.dll
Syntax
public sealed class EventBus : IEventBus, IReadOnlyEventBus
Methods
Post<T>(T)
Posts and event.
Declaration
public void Post<T>(T event)
where T : IEvent
Parameters
Type | Name | Description |
---|---|---|
T | event | An event instance to post. |
Type Parameters
Name | Description |
---|---|
T | Event Type. |
Subscribe<T>(Action<T>)
Subscribes listener to a certain event type.
Declaration
public 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
public 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. |