Interface TransactionService<T, S>

Hierarchy

Implemented by

Index

Properties

canRedo: boolean
returns

if there are any transactions in the Redo stack

canUndo: boolean
returns

if there are any transactions in the Undo stack

cloneStrategy: IDataCloneStrategy

Gets/Sets the data clone strategy used to clone data

enabled: boolean

Returns whether transaction is enabled for this service

onStateUpdate?: EventEmitter<StateUpdateEvent>

Event fired when transaction state has changed - add transaction, commit all transactions, undo and redo

Methods

  • add(transaction: T, recordRef?: any): void
  • clear(id?: any): void
  • commit(data: any[], id?: any): void
  • endPending(commit: boolean): void
  • getAggregatedChanges(mergeChanges: boolean): T[]
  • Returns aggregated changes from all transactions

    Parameters

    • mergeChanges: boolean

      If set to true will merge each state's value over relate recordRef and will record resulting value in the related transaction

    Returns T[]

    Collection of aggregated transactions for each changed record

  • getAggregatedValue(id: any, mergeChanges: boolean): any
  • getState(id: any, pending?: boolean): S
  • getTransactionLog(id?: any): T[]
  • redo(): void
  • startPending(): void
  • undo(): void