Class: NavDataBarFieldConsumerModel<S, C>
A navigation data bar field data model which uses an arbitrary subscribable to provide its value and function to update the value using data cached from one or more event bus consumers.
Deprecated
Please use NavDataBarFieldConsumerValueModel instead.
Type parameters
Name | Type |
---|---|
S | extends Subscribable <any > |
C | extends [...any[]] |
Hierarchy
NavDataBarFieldGenericModel
<S
, (sub
:S
,gpsValidity
:Subscribable
<NavDataFieldGpsValidity
>,consumerSubs
:SubscribableTypeMap
<C
>) =>void
>↳
NavDataBarFieldConsumerModel
Constructors
constructor
• new NavDataBarFieldConsumerModel<S
, C
>(sub
, gpsValidity
, consumers
, initialValues
, updateFunc
): NavDataBarFieldConsumerModel
<S
, C
>
Constructor.
Type parameters
Name | Type |
---|---|
S | extends Subscribable <any > |
C | extends any [] |
Parameters
Name | Type | Description |
---|---|---|
sub | S | The subscribable used to provide this model's value. |
gpsValidity | Subscribable <NavDataFieldGpsValidity > | The current validity state of the GPS data for this model. |
consumers | ConsumerTypeMap <C > | The event bus consumers used by this model. |
initialValues | C | The initial consumer values with which to initialize this model. These values will be used until they are replaced by consumed values from the event bus. |
updateFunc | (sub : S , gpsValidity : Subscribable <NavDataFieldGpsValidity >, consumerSubs : SubscribableTypeMap <C >) => void | The function used to update this model's value. The first argument taken by the function is the subscribable used to provide this model's value. The second argument is a tuple of Subscribables providing the cached values from this model's consumers. |
Returns
NavDataBarFieldConsumerModel
<S
, C
>
Overrides
NavDataBarFieldGenericModel.constructor
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:143
Properties
consumerSubs
• Protected
Readonly
consumerSubs: ConsumerSubjectTypeMap
<C
>
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:130
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
NavDataBarFieldGenericModel.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
NavDataBarFieldGenericModel.gpsValidity
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
updateFunc
• Protected
Readonly
updateFunc: (sub
: S
, gpsValidity
: Subscribable
<NavDataFieldGpsValidity
>, consumerSubs
: SubscribableTypeMap
<C
>) => 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
, consumerSubs
): 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 | S |
gpsValidity | Subscribable <NavDataFieldGpsValidity > |
consumerSubs | SubscribableTypeMap <C > |
Returns
void
Inherited from
NavDataBarFieldGenericModel.updateFunc
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
value
• Readonly
value: Subscribable
<SubscribableType
<S
>>
A subscribable which provides this model's value.
Inherited from
NavDataBarFieldGenericModel.value
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:63
Methods
destroy
▸ destroy(): void
Destroys this model.
Returns
void
Inherited from
NavDataBarFieldGenericModel.destroy
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:83
update
▸ update(): void
Updates this model.
Returns
void
Overrides
NavDataBarFieldGenericModel.update
Defined in
src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:160