Skip to content

📡 4.2.0

Compare
Choose a tag to compare
@littensy littensy released this 29 Jul 02:12
· 16 commits to master since this release

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 to 0, 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's options.hydrate function.

Full Changelog: v4.1.0...v4.2.0