Class: NavDataBarFieldConsumerValueNumberUnitModel<F, U>
A navigation data bar field data model which provides a NumberUnitInterface value that is derived directly from an event bus consumer.
Type parameters
Name | Type |
---|---|
F | extends string |
U | extends Unit <F > = Unit <F > |
Hierarchy
NavDataBarFieldConsumerValueModel
<NumberUnitSubject
<F
,U
>, [number
]>↳
NavDataBarFieldConsumerValueNumberUnitModel
Constructors
constructor
• new NavDataBarFieldConsumerValueNumberUnitModel<F
, U
>(gpsValidity
, consumer
, initialVal
, consumerUnit
, onDestroy?
): NavDataBarFieldConsumerValueNumberUnitModel
<F
, U
>
Creates a new instance of NavDataBarFieldConsumerValueNumberUnitModel.
Type parameters
Name | Type |
---|---|
F | extends string |
U | extends Unit <F > = Unit <F > |
Parameters
Name | Type | Description |
---|---|---|
gpsValidity | Subscribable <NavDataFieldGpsValidity > | The current validity state of the GPS data for this model. |
consumer | Consumer <number > | Subscribable <null | Consumer <number >> | The event bus consumer used to derive this model's value. |
initialVal | number | The initial consumer value with which to initialize this model. This value will be used until it is replaced by a consumed value from the event bus. |
consumerUnit | U | The unit type of the values consumed from the event bus. |
onDestroy? | () => void | A function which will be called when the model is destroyed. |
Returns
NavDataBarFieldConsumerValueNumberUnitModel
<F
, U
>
Overrides
NavDataBarFieldConsumerValueModel.constructor
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:283
Properties
consumerSubs
• Protected
Readonly
consumerSubs: Subscription
[] = []
Inherited from
NavDataBarFieldConsumerValueModel.consumerSubs
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:212
consumerValues
• Protected
Readonly
consumerValues: ConsumerValueTypeMap
<[number
]>
Inherited from
NavDataBarFieldConsumerValueModel.consumerValues
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:211
destroyFunc
• Protected
Optional
Readonly
destroyFunc: () => void
A function which is executed when this model is destroyed.
Type declaration
▸ (): void
A function which is executed when this model is destroyed.
Returns
void
Inherited from
NavDataBarFieldConsumerValueModel.destroyFunc
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
gpsValidity
• Readonly
gpsValidity: Subscribable
<NavDataFieldGpsValidity
>
The current validity state of the GPS data for this model.
Inherited from
NavDataBarFieldConsumerValueModel.gpsValidity
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
updateFunc
• Protected
Readonly
updateFunc: (sub
: NumberUnitSubject
<F
, U
>, gpsValidity
: Subscribable
<NavDataFieldGpsValidity
>, consumerValues
: ReadonlyConsumerValueTypeMap
<[number
]>) => void
The function used to update this model's value. Can take an arbitrary number of arguments, but the first must be the subscribable used to provide this model's value, and the second the model's GPS validity.
Type declaration
▸ (sub
, gpsValidity
, consumerValues
): void
The function used to update this model's value. Can take an arbitrary number of arguments, but the first must be the subscribable used to provide this model's value, and the second the model's GPS validity.
Parameters
Name | Type |
---|---|
sub | NumberUnitSubject <F , U > |
gpsValidity | Subscribable <NavDataFieldGpsValidity > |
consumerValues | ReadonlyConsumerValueTypeMap <[number ]> |
Returns
void
Inherited from
NavDataBarFieldConsumerValueModel.updateFunc
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
value
• Readonly
value: Subscribable
<NumberUnitInterface
<F
, U
>>
A subscribable which provides this model's value.
Inherited from
NavDataBarFieldConsumerValueModel.value
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:63
Methods
destroy
▸ destroy(): void
Destroys this model.
Returns
void
Inherited from
NavDataBarFieldConsumerValueModel.destroy
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:83
update
▸ update(): void
Updates this model.
Returns
void
Inherited from
NavDataBarFieldConsumerValueModel.update
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:262