Skip to main content

Class: ExistingUserWaypointsArray

Defined in: src/sdk/navigation/ExistingUserWaypointsArray.ts:27

An array of all existing user waypoints. Each instance of this class is automatically updated to contain all existing user waypoints in the order in which they were added.

Extends​

Constructors​

Constructor​

new ExistingUserWaypointsArray(facRepo, bus, facWaypointCache, options?): ExistingUserWaypointsArray

Defined in: src/sdk/navigation/ExistingUserWaypointsArray.ts:47

Creates a new instance of ExistingUserWaypointsArray.

Parameters​

ParameterTypeDescription
facRepoFacilityRepositoryThe facility repository.
busEventBusThe event bus.
facWaypointCacheFacilityWaypointCacheA cache from which to retrieve facility waypoints.
options?Readonly<ExistingUserWaypointsArrayOptions>Options with which to configure the array.

Returns​

ExistingUserWaypointsArray

Overrides​

AbstractSubscribableArray.constructor

Properties​

initialNotifyFunc()​

protected readonly initialNotifyFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:20

A function which sends initial notifications to subscriptions.

Notifies a subscription of this array's current state.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to notify.

Returns​

void

Inherited from​

AbstractSubscribableArray.initialNotifyFunc


notifyDepth​

protected notifyDepth: number = 0

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:17

Inherited from​

AbstractSubscribableArray.notifyDepth


onSubDestroyedFunc()​

protected readonly onSubDestroyedFunc: (sub) => void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:23

A function which responds to when a subscription to this subscribable is destroyed.

Responds to when a subscription to this array is destroyed.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The destroyed subscription.

Returns​

void

Inherited from​

AbstractSubscribableArray.onSubDestroyedFunc


singletonSub?​

protected optional singletonSub: HandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:14

Inherited from​

AbstractSubscribableArray.singletonSub


subs?​

protected optional subs: HandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>[]

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:16

Inherited from​

AbstractSubscribableArray.subs

Accessors​

length​

Get Signature​

get length(): number

Defined in: src/sdk/navigation/ExistingUserWaypointsArray.ts:34

The length of this array.

Returns​

number

The length of this array.

Overrides​

AbstractSubscribableArray.length

Methods​

addSubscription()​

protected addSubscription(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:29

Adds a subscription to this array.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to add.

Returns​

void

Inherited from​

AbstractSubscribableArray.addSubscription


destroy()​

destroy(): void

Defined in: src/sdk/navigation/ExistingUserWaypointsArray.ts:110

Destroys this array. Once destroyed, the state of the array will no longer reflect all existing user waypoints.

Returns​

void


get()​

get(index): FacilityWaypoint

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:64

Gets an item from the array.

Parameters​

ParameterTypeDescription
indexnumberThex index of the item to get.

Returns​

FacilityWaypoint

An item.

Throws​

Inherited from​

AbstractSubscribableArray.get


getArray()​

getArray(): readonly FacilityWaypoint<UserFacility>[]

Defined in: src/sdk/navigation/ExistingUserWaypointsArray.ts:72

Gets a read-only version of this array.

Returns​

readonly FacilityWaypoint<UserFacility>[]

a read-only version of this array.

Overrides​

AbstractSubscribableArray.getArray


initialNotify()​

protected initialNotify(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:163

Notifies a subscription of this array's current state.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The subscription to notify.

Returns​

void

Inherited from​

AbstractSubscribableArray.initialNotify


notify()​

protected notify(index, type, modifiedItem?): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:87

Notifies subscriptions of a change in the array.

Parameters​

ParameterTypeDescription
indexnumberThe index that was changed.
typeSubscribableArrayEventTypeThe type of subject event.
modifiedItem?FacilityWaypoint<UserFacility> | readonly FacilityWaypoint<UserFacility>[]The item modified by the operation.

Returns​

void

Inherited from​

AbstractSubscribableArray.notify


onSubDestroyed()​

protected onSubDestroyed(sub): void

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:172

Responds to when a subscription to this array is destroyed.

Parameters​

ParameterTypeDescription
subHandlerSubscription<SubscribableArrayHandler<FacilityWaypoint<UserFacility>>>The destroyed subscription.

Returns​

void

Inherited from​

AbstractSubscribableArray.onSubDestroyed


sub()​

sub(handler, initialNotify, paused): Subscription

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:41

Subscribes to changes in this array's state.

Parameters​

ParameterTypeDefault valueDescription
handlerSubscribableArrayHandler<FacilityWaypoint<UserFacility>>undefinedA function which is called when this array's state changes.
initialNotifybooleanfalseWhether to immediately invoke the callback function with this array's current state. Defaults to false. This argument is ignored if the subscription is initialized as paused.
pausedbooleanfalseWhether the new subscription should be initialized as paused. Defaults to false.

Returns​

Subscription

The new subscription.

Inherited from​

AbstractSubscribableArray.sub


tryGet()​

tryGet(index): FacilityWaypoint<UserFacility> | undefined

Defined in: src/sdk/sub/AbstractSubscribableArray.ts:77

Tries to get the value from the array.

Parameters​

ParameterTypeDescription
indexnumberThe index of the item to get.

Returns​

FacilityWaypoint<UserFacility> | undefined

The value or undefined if not found.

Inherited from​

AbstractSubscribableArray.tryGet