Home Reference Source
import {LocalPrioritisedArray} from 'arva-js/data/local/LocalPrioritisedArray.js'
public class | source

LocalPrioritisedArray

Extends:

ArrayPrioritisedArray → LocalPrioritisedArray

Constructor Summary

Public Constructor
public

constructor(dataType: *)

Inherited Summary

From class PrioritisedArray
public get

The number of items in the (synchronized or local) data set.

public set

length(value: Number): *: *

A setter on the length is necessary because internal methods of Array modify the lngth.

public

add(model: Model | Object, prevSiblingId: String): Object

Adds a model instance to the rear of the PrioritisedArray, and emits a 'child_added' and possibly 'new_child' event after successful addition.

public

findById(id: *): Model

Finds an item based on its Id in the datasource.

public

insertAt(model: Model, position: Number): Object

Inserts a model instance at the given position of the PrioritisedArray, and recalculates the priority (position) of all models after the inserted position.

public

off(event: String, handler: Function, context: Object): void

Removes subscription to events emitted by this PrioritisedArray.

public

on(event: String, handler: Function, context: Object): void

Subscribes to events emitted by this PrioritisedArray.

public

once(event: String, handler: Function, context: Object): Promise

Subscribes to the given event type exactly once; it automatically unsubscribes after the first time it is triggered.

public

push(model: Object | Model): Model

Adds a model or object to the end of the list.

public

remove(position: Number): void

Removes the model instance at the given position.

Public Constructors

public constructor(dataType: *) source

Override:

PrioritisedArray#constructor

Params:

NameTypeAttributeDescription
dataType *