TransientObject(opts) → {TransientObject}

An abstract class for objects that will be collected and potentially stored in non-volitile storage when they are no longer immediately needed.

new TransientObject(opts) → {TransientObject}

Constructor for TransientObject

Parameters:
Name Type Description
opts Object

Options for the new TransientObject

Properties
Name Type Description
id any

An optional globally unique identifier for the TransientObject.

Returns:
TransientObject -

The newly created Transient object wrapped in a Proxy object. The Proxy redirects any get / set access to the data property of hte object.

Methods

async, static deleteId(id) → {boolean}

Method for deleting an object with the matching id

Parameters:
Name Type Description
id any

The ID to match

Returns:
boolean -

Returns true on success, false on failure

async delete()

Abstract function for deleting for the TransientObject. Classes that derive from this class will overload this function.

async load()

Abstract loader for the TransientObject. Classes that derive from this class will overload this function.

async store()

Abstract function for storing for the TransientObject. Classes that derive from this class will overload this function.

toJson()

Synonym for toString()

toString() → {string}

Converts the transient object to a string.

Returns:
string -

A string representation of the TransientObject