Home Manual Reference Source Repository
import {EventBus} from 'ug-layout/events/EventBus'
public class | source

EventBus

Custom eventing bus that abstracts common patterns between events.

Constructor Summary

Public Constructor
public

Creates an instance of EventBus.

Method Summary

Public Methods
public

next(event: T)

Dispatches an event.

public

scope(Event: Type<T>): Observable<T>

Creates an observable scoped to a specific event type.

public

subscribe(Event: Type<T>, observer: PartialObserver<T> | ((event: T) => void)): Subscription

Subscribes to a specific event type.

Public Constructors

public constructor() source

Creates an instance of EventBus.

Public Methods

public next(event: T) source

Dispatches an event.

Params:

NameTypeAttributeDescription
event T

public scope(Event: Type<T>): Observable<T> source

Creates an observable scoped to a specific event type.

Params:

NameTypeAttributeDescription
Event Type<T>

Return:

Observable<T>

public subscribe(Event: Type<T>, observer: PartialObserver<T> | ((event: T) => void)): Subscription source

Subscribes to a specific event type.

Params:

NameTypeAttributeDescription
Event Type<T>
observer PartialObserver<T> | ((event: T) => void)

Return:

Subscription