Class Transaction

A Transaction holds a list of ChangedEvents collected during a transaction, as the value of the read-only #changes} property.

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): Transaction

Construct an object holding an empty list of ChangedEvents and no #name.

Returns

Transaction

Properties

public changes: List

Gets the list of ChangedEvents.

public isComplete: boolean

Gets or sets whether we can add more ChangedEvents to this list of changes.

public name: string

Gets or sets the transaction name for this collection of changes.

Methods

public canRedo(): boolean

This predicate returns true if you can call #redo, namely when #isComplete is true.

Returns

boolean

public canUndo(): boolean

This predicate returns true if you can call #undo, namely when #isComplete is true.

Returns

boolean

public clear(): any

Clear all of the saved changes.

Returns

any

public redo(): any

Re-perform these changes after an #undo.

Returns

any

public undo(): any

Undo all of the changes, in reverse order.

Returns

any