encodeStateFromSnapshotV1 method
Implementation
Result<Uint8List, Error> encodeStateFromSnapshotV1({
required YDoc doc,
required YSnapshot snapshot,
}) {
final results = _encodeStateFromSnapshotV1([
doc.toWasm(),
snapshot.toWasm(),
]);
final result = results[0];
return Result.fromJson(
result,
(ok) => (ok is Uint8List ? ok : Uint8List.fromList((ok! as List).cast())),
(error) => error is String ? error : (error! as ParsedString).value,
);
}