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
Parameter | Type | Description |
---|---|---|
bus | EventBus | An 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
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
Parameter | Type | Description |
---|---|---|
index | number | The index of the element. |
Returns
the element at the specified index.
Throws
Error if index is out of bounds.
Implementation of
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
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
Parameter | Type | Default value | Description |
---|---|---|---|
handler | SubscribableArrayHandler <AlertMessage > | undefined | A function which is called when this array's state changes. |
initialNotify | boolean | false | Whether 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. |
paused | boolean | false | Whether the new subscription should be initialized as paused. Defaults to false . |
Returns
The new subscription.
Implementation of
tryGet()
tryGet(
index
):undefined
|AlertMessage
Defined in: workingtitle-instruments-g1000/html_ui/PFD/Components/UI/Alerts/AlertsSubject.ts:123
Attempts to retrieve an element from this array.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the element. |
Returns
undefined
| AlertMessage
the element at the specified index, or undefined if index is out of bounds.