Skip to main content

Class: NavDataBarFieldConsumerValueNumberUnitModel<F, U>

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

A navigation data bar field data model which provides a NumberUnitInterface value that is derived directly from an event bus consumer.

Extends

Type Parameters

Type ParameterDefault type
F extends string-
U extends Unit<F>Unit<F>

Constructors

Constructor

new NavDataBarFieldConsumerValueNumberUnitModel<F, U>(gpsValidity, consumer, initialVal, consumerUnit, onDestroy?): NavDataBarFieldConsumerValueNumberUnitModel<F, U>

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

Creates a new instance of NavDataBarFieldConsumerValueNumberUnitModel.

Parameters

ParameterTypeDescription
gpsValiditySubscribable<NavDataFieldGpsValidity>The current validity state of the GPS data for this model.
consumerConsumer<number> | Subscribable<null | Consumer<number>>The event bus consumer used to derive this model's value.
initialValnumberThe initial consumer value with which to initialize this model. This value will be used until it is replaced by a consumed value from the event bus.
consumerUnitUThe unit type of the values consumed from the event bus.
onDestroy?() => voidA function which will be called when the model is destroyed.

Returns

NavDataBarFieldConsumerValueNumberUnitModel<F, U>

Overrides

NavDataBarFieldConsumerValueModel.constructor

Properties

consumerSubs

protected readonly consumerSubs: Subscription[] = []

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

Inherited from

NavDataBarFieldConsumerValueModel.consumerSubs


consumerValues

protected readonly consumerValues: ConsumerValueTypeMap<[number]>

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

Inherited from

NavDataBarFieldConsumerValueModel.consumerValues


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

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

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

ParameterType
subNumberUnitSubject
gpsValiditySubscribable<NavDataFieldGpsValidity>
consumerValuesReadonlyConsumerValueTypeMap<[number]>

Returns

void

Inherited from

NavDataBarFieldConsumerValueModel.updateFunc


value

readonly value: Subscribable<NumberUnitInterface<F, U>>

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

A subscribable which provides this model's value.

Inherited from

NavDataBarFieldConsumerValueModel.value

Methods

destroy()

destroy(): void

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

Destroys this model.

Returns

void

Inherited from

NavDataBarFieldConsumerValueModel.destroy


update()

update(): void

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

Updates this model.

Returns

void

Inherited from

NavDataBarFieldConsumerValueModel.update