Skip to content

Function: decodePatchFrame() ​

ts
function decodePatchFrame(bytes, keys): PatchFrame;

Defined in: binary.ts:483

Reads a binary patch frame into the same object its JSON form would parse to. keys is the table of the connection the frame came on: start each connection with an empty array and hand in the same one every time. The frame's key definitions are added to it, after it has been emptied if the frame says to forget.

Throws if the bytes are not a frame of this format. The connection's table can then no longer be trusted: reconnect.

Parameters ​

ParameterType
bytesUint8Array
keysstring[]

Returns ​

PatchFrame

MIT licence. Tickflare is an independent project and is not affiliated with Cloudflare.