Skip to main content

Class: NavDataBarFieldConsumerModel<S, C>

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:127

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.

Extends

Extended by

Type Parameters

Type Parameter
S extends Subscribable<any>
C extends [...any[]]

Constructors

Constructor

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

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:143

Constructor.

Parameters

ParameterTypeDescription
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, gpsValidity, consumerSubs) => 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

Properties

consumerSubs

protected readonly consumerSubs: ConsumerSubjectTypeMap<C>

Defined in: src/garminsdk/components/navdatabar/NavDataBarFieldModel.ts:130


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, consumerSubs) => 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

ParameterType
subS
gpsValiditySubscribable<NavDataFieldGpsValidity>
consumerSubsSubscribableTypeMap<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:160

Updates this model.

Returns

void

Overrides

NavDataBarFieldGenericModel.update