encodeStateAsUpdateV2 method
Implementation
Result<Uint8List, Error> encodeStateAsUpdateV2({
required YDoc ref,
Uint8List? vector,
}) {
final results = _encodeStateAsUpdateV2([
ref.toWasm(),
(vector == null
? const None().toWasm()
: Option.fromValue(vector).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);
}