maxHistoryLength property

num get maxHistoryLength

Gets or sets the maximum number of transactions that this undo manager will remember. When a transaction is committed and the number exceeds this value, the UndoManager will discard the oldest transaction(s) in order to meet this limit. The initial value is 999. Any new value must be an integer. A negative value is treated as if there were no limit. A zero value will not remember any Transactions in the #history, but will allow commits and rollbacks to occur normally, including raising "Transaction" type ChangedEvents.

This property is useful in helping limit the memory consumption of typical applications. But this does not limit the number of ChangedEvents that are recorded, because there may be an unlimited number of those within each Transaction. Decreasing this value will not necessarily remove any existing Transactions if there currently exist more in #history than the new value permits.

Implementation

_i2.num get maxHistoryLength => _i4.getProperty(
      this,
      'maxHistoryLength',
    );
set maxHistoryLength (num value)

Implementation

set maxHistoryLength(_i2.num value) {
  _i4.setProperty(
    this,
    'maxHistoryLength',
    value,
  );
}