Skip to main content

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

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

Hierarchy

Constructors

constructor

new NavDataBarFieldConsumerModel<S, C>(sub, gpsValidity, consumers, initialValues, updateFunc): NavDataBarFieldConsumerModel<S, C>

Constructor.

Type parameters

NameType
Sextends Subscribable<any>
Cextends 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.
consumersConsumerTypeMap<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: SubscribableTypeMap<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 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
NameType
subS
gpsValiditySubscribable<NavDataFieldGpsValidity>
consumerSubsSubscribableTypeMap<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