cast<T> method

T cast<T>(
  1. T fromJson(
    1. JsonMap documentId
    )
)

Casts the full document payload to a typed object using fromJson.

Throws if the full document is not present.

Implementation

T cast<T>(T Function(JsonMap documentId) fromJson) {
  if (fullDocument == null) {
    throw StateError('No full document available for this change.');
  }
  return fromJson(fullDocument!);
}