Skip to main content

CollectionData

view on npm

A piece of data belonging to a collection

.id : string

The internal id of the state with an instance prefix

.instanceId : string

The internal id of the state with an instance prefix

.value : DataType

Get the value of the data instance

.shallowValue : DataType

Get the shallow value of the data instance (no foreign key values injected)

.lastValue : DataType

The previous (reactive) value of the state

.initialValue : DataType

The initial (default) value of the state

.set(value) ⇒ this

Set the value of the data instance

Returns: this

The data instance

ParamTypeDescription
valueDataType

The value to set

.patch(value) ⇒ this

Patch the current value of the state

Returns: this

The data instance

ParamTypeDescription
valueDataType

A value of the state to merge with the current value

.isEqual(value) ⇒ boolean

Compare a thing to the current value, if they are equal, returns true

Returns: boolean

A boolean representing if they are equal

ParamDescription
value

The thing to compare the current value to

.delete() ⇒ this

Delete the data instance

Returns: this

The data instance

.clean() ⇒ this

Clean this data instance (remove all watchers & remove the state from the instance)

Returns: this

The data instance