Skip to main content

Class: AlertsSubject

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:39

A subject that tracks G1000 alert messages.

Implements​

Constructors​

Constructor​

new AlertsSubject(bus): AlertsSubject

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:51

Creates an instance of a AlertsSubject.

Parameters​

ParameterTypeDescription
busEventBusAn instance of the event bus.

Returns​

AlertsSubject

Accessors​

length​

Get Signature​

get length(): number

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:113

The length of this array.

Returns​

number

The length of this array.

Implementation of​

SubscribableArray.length

Methods​

get()​

get(index): AlertMessage

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:118

Retrieves an element from this array.

Parameters​

ParameterTypeDescription
indexnumberThe index of the element.

Returns​

AlertMessage

the element at the specified index.

Throws​

Error if index is out of bounds.

Implementation of​

SubscribableArray.get


getArray()​

getArray(): readonly AlertMessage[]

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:128

Gets a read-only version of this array.

Returns​

readonly AlertMessage[]

a read-only version of this array.

Implementation of​

SubscribableArray.getArray


sub()​

sub(handler, initialNotify, paused): Subscription

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:133

Subscribes to changes in this array's state.

Parameters​

ParameterTypeDefault valueDescription
handlerSubscribableArrayHandler<AlertMessage>undefinedA function which is called when this array's state changes.
initialNotifybooleanfalseWhether to immediately invoke the callback function with this array's current state. Defaults to false. This argument is ignored if the subscription is initialized as paused.
pausedbooleanfalseWhether the new subscription should be initialized as paused. Defaults to false.

Returns​

Subscription

The new subscription.

Implementation of​

SubscribableArray.sub


tryGet()​

tryGet(index): AlertMessage | undefined

Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:123

Attempts to retrieve an element from this array.

Parameters​

ParameterTypeDescription
indexnumberThe index of the element.

Returns​

AlertMessage | undefined

the element at the specified index, or undefined if index is out of bounds.

Implementation of​

SubscribableArray.tryGet