applyTo method

Object? applyTo(
  1. dynamic document
)

Returns a copy of the document with all operations applied sequentially. Throws OperationFailure if any operation fails.

Implementation

Object? applyTo(document) => fold(document, (doc, op) {
      try {
        return op.apply(doc);
      } on OperationFailure {
        rethrow;
      } catch (e) {
        throw OperationFailure(op, reason: e);
      }
    });