applyTo method
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);
}
});