Skip to main content

Class: NavDataBarFieldConsumerValueModel<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.

Type parameters

NameType
Sextends Subscribable<any>
Cextends readonly [...any[]]

Hierarchy

Constructors

constructor

new NavDataBarFieldConsumerValueModel<S, C>(sub, gpsValidity, consumers, initialValues, updateFunc, onDestroy?): NavDataBarFieldConsumerValueModel<S, C>

Creates a new instance of NavDataBarFieldConsumerValueModel.

Type parameters

NameType
Sextends Subscribable<any>
Cextends readonly any[]

Parameters

NameTypeDescription
subSThe subscribable used to provide this model's value.
gpsValiditySubscribable<NavDataFieldGpsValidity>The current validity state of the GPS data for this model.
consumersOptionalSubscribableConsumerTypeMap<C>The event bus consumers used by this model.
initialValuesCThe 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: ReadonlyConsumerValueTypeMap<C>) => voidThe 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?() => voidA function which will be called when the model is destroyed.

Returns

NavDataBarFieldConsumerValueModel<S, C>

Overrides

NavDataBarFieldGenericModel.constructor

Defined in

src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:226

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 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>, consumerValues: ReadonlyConsumerValueTypeMap<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, 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
NameType
subS
gpsValiditySubscribable<NavDataFieldGpsValidity>
consumerValuesReadonlyConsumerValueTypeMap<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:262