📡 4.2.0
This release implements broadcast batching and an optional explicit hydration handler to reduce stress on a single remote.
✨ What's Changed
📚 API
createBroadcaster
options.dispatchRate = 0
: The rate at which the server should broadcast actions to the clients. If this is set to0
, actions are broadcast with the next server heartbeat.options.hydrate(player, state)?
: An optional custom hydration function. If provided, this function will be called instead of being implicitly handled by 'dispatch'. Useful for reducing load on a single remote if your state is large.
createBroadcastReceiver
receiver.hydrate(state)
: Hydrates the root producer with the given state. State should be received from the broadcaster'soptions.hydrate
function.
Full Changelog: v4.1.0...v4.2.0