applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => {
  const decoder = decoding.createDecoder(update);
  readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder));
}
Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.

This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.

@param {Doc} ydoc
@param {Uint8Array} update
@param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`
@param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]

@function