Skip to content

Changes

The Changes class provides methods for managing changes in a context.

Constructors

new Changes(store, changes)

new Changes(store, changes?): Changes

Creates a new instance of the Changes class.

Parameters

store: StorageInterface

The store in which changes are to be managed.

changes?: ChangesInput

An optional initial set of changes.

Returns

Changes

Source

ecmascript/src/changes.ts:29

Methods

changeComponent()

changeComponent(id, key, newValue, prevValue, isAsyncStorage): Promise<any[]>

Changes a component in the current context.

Parameters

id: string

The ID of the component to be changed.

key: string

The key of the property to be changed.

newValue: any

The new value of the property.

prevValue: any

The previous value of the property.

isAsyncStorage: boolean= false

Whether the storage is asynchronous.

Returns

Promise<any[]>

The new value.

Source

ecmascript/src/changes.ts:44


getValue()

getValue(id, key, storedValue): Record<string, any>

Retrieves the changes of a value.

Parameters

id: string

The ID of the component.

key: string

The key of the property.

storedValue: any

The stored value.

Returns

Record<string, any>

The diffs.

Source

ecmascript/src/changes.ts:56


reset()

reset(changes?): Changes

Resets the changes to a new set of changes or an empty object if no changes are provided.

Parameters

changes?: ChangesInput

The new set of changes.

Returns

Changes

The instance of the Changes class.

Source

ecmascript/src/changes.ts:72


upsertComponent()

upsertComponent(id, key, newValue, _prevValue, isAsyncStorage): any

Updates an existing component or inserts a new one if it doesn’t exist in the current context.

Parameters

id: string

The ID of the component to be updated or inserted.

key: string

The key of the property to be updated or inserted.

newValue: any

The new value of the property.

_prevValue: any

The previous value of the property.

isAsyncStorage: boolean= false

Whether the storage is asynchronous.

Returns

any

The new value.

Source

ecmascript/src/changes.ts:87


Generated using typedoc-plugin-markdown and TypeDoc