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

BusEvent

Direct Subclass:

Command

An event that can be dispatched from the event bus.

Constructor Summary

Public Constructor
public

constructor(_target: T, _options: BusEventOptions, _parent: BusEvent<any> | null)

Creates an instance of BusEvent.

Member Summary

Public Members
public get

done: Promise<this>

A Promise that resolves when the event is 'done'.

public get

Whether the propagation of this event is stopped.

public get

The options provided to this event.

public get

origin: *

The origin event.

public get

target: T

The target of the event.

Method Summary

Public Methods
public

delegate(Ctor: Type<U>, target: *, options: BusEventOptions): U

Creates a new event with a new target and setting this event as the _parent of the new event.

public

dispatch(subscriber: Observer<this>)

Implements how this event is dispatched on the given event bus.

public

Stops the propagation of the event.

public

wait(fn: function(): *): void

Adds a function that will execute and hold up the finishing of this event until the given promise resolves.

Public Constructors

public constructor(_target: T, _options: BusEventOptions, _parent: BusEvent<any> | null) source

Creates an instance of BusEvent.

Params:

NameTypeAttributeDescription
_target T
_options BusEventOptions
  • optional
  • default: {}
_parent BusEvent<any> | null
  • optional
  • default: null

Public Members

public get done: Promise<this> source

A Promise that resolves when the event is 'done'.

public get isPropagationStopped: boolean source

Whether the propagation of this event is stopped.

public get options: BusEventOptions source

The options provided to this event.

public get origin: * source

The origin event.

public get target: T source

The target of the event.

Public Methods

public delegate(Ctor: Type<U>, target: *, options: BusEventOptions): U source

Creates a new event with a new target and setting this event as the _parent of the new event. This will merge options with the previou event.

Params:

NameTypeAttributeDescription
Ctor Type<U>
target *
  • optional
  • default: this.target
options BusEventOptions
  • optional
  • default: {}

Return:

U

public dispatch(subscriber: Observer<this>) source

Implements how this event is dispatched on the given event bus.

Params:

NameTypeAttributeDescription
subscriber Observer<this>

public stopPropagation() source

Stops the propagation of the event.

public wait(fn: function(): *): void source

Adds a function that will execute and hold up the finishing of this event until the given promise resolves. These are executed in the order the are received.

Params:

NameTypeAttributeDescription
fn function(): *

Return:

void