Class: NavDataBarFieldConsumerValueModel<S, C>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:208
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.
Extends
NavDataBarFieldGenericModel
<S
, (sub
,gpsValidity
,consumerValues
) =>void
>
Extended by
Type Parameters
Type Parameter |
---|
S extends Subscribable <any > |
C extends readonly [...any[] ] |
Constructors
Constructor
new NavDataBarFieldConsumerValueModel<
S
,C
>(sub
,gpsValidity
,consumers
,initialValues
,updateFunc
,onDestroy?
):NavDataBarFieldConsumerValueModel
<S
,C
>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:226
Creates a new instance of NavDataBarFieldConsumerValueModel.
Parameters
Parameter | 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 | OptionalSubscribableConsumerTypeMap <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 , gpsValidity , consumerSubs ) => 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 ReadonlyConsumerValue objects providing the cached values from this model's consumers. |
onDestroy? | () => void | A function which will be called when the model is destroyed. |
Returns
NavDataBarFieldConsumerValueModel
<S
, C
>
Overrides
NavDataBarFieldGenericModel
.constructor
Properties
consumerSubs
protected
readonly
consumerSubs:Subscription
[] =[]
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:212
consumerValues
protected
readonly
consumerValues:ConsumerValueTypeMap
<C
>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:211
destroyFunc()?
protected
readonly
optional
destroyFunc: () =>void
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
A function which is executed when this model is destroyed.
Returns
void
Inherited from
NavDataBarFieldGenericModel
.destroyFunc
gpsValidity
readonly
gpsValidity:Subscribable
<NavDataFieldGpsValidity
>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
The current validity state of the GPS data for this model.
Inherited from
NavDataBarFieldGenericModel
.gpsValidity
updateFunc()
protected
readonly
updateFunc: (sub
,gpsValidity
,consumerValues
) =>void
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:73
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
Parameter | Type |
---|---|
sub | S |
gpsValidity | Subscribable <NavDataFieldGpsValidity > |
consumerValues | ReadonlyConsumerValueTypeMap <C > |
Returns
void
Inherited from
NavDataBarFieldGenericModel
.updateFunc
value
readonly
value:Subscribable
<SubscribableType
<S
>>
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:63
A subscribable which provides this model's value.
Inherited from
NavDataBarFieldGenericModel
.value
Methods
destroy()
destroy():
void
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:83
Destroys this model.
Returns
void
Inherited from
NavDataBarFieldGenericModel
.destroy
update()
update():
void
Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:262
Updates this model.
Returns
void