indexFunctions
Function: restoreDiffMaybeOffloaded()
> restoreDiffMaybeOffloaded<T>(state, stateDiff): Promise<T>
Defined in: src/worker/offload.ts:13
Applies stateDiff to state, via the registered game worker if one is available (see
Game.worker), falling back to computing it synchronously on the main thread otherwise -
whether that's because no worker was registered, or because the worker call itself failed (the
caller should never hard-fail just because the optional worker hiccuped).
Type Parameters
T
T extends object
Parameters
state
T
stateDiff
Difference[]
Returns
Promise<T>