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

LocalModel

Extends:

eventemitter3~EventEmitterPrioritisedObjectModel → LocalModel

Constructor Summary

Public Constructor
public

constructor(id: *, data: *)

Member Summary

Public Members
public get

id: *

public set

id: *

Inherited Summary

From class PrioritisedObject
public get
public get

id: *

public set

id: *

public get

Priority (positioning) of the object in the dataSource

public set
public

Disables pushes of local changes to the dataSource, and stops event emits that refer to the model's data.

public

Enables pushes of local changes to the dataSource, and enables event emits that refer to the model's data. The change listener is active by default, so you'll only need to call this method if you've previously called disableChangeListener().

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): void

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

public

remove(): void

Deletes the current object from the dataSource, and clears itself to free memory.

public

transaction(method: Function): void

Allows multiple modifications to be made to the model without triggering dataSource pushes and event emits for each change.

From class Model
public

Check if the model has been synchonized with the database

Public Constructors

public constructor(id: *, data: *) source

Override:

Model#constructor

Params:

NameTypeAttributeDescription
id *
data *

Public Members

public get id: * source

Override:

PrioritisedObject#id

public set id: * source

Override:

PrioritisedObject#id