Replace the persistent state wholesale (no merging) and return it. UnlikeprotectedreplaceState(next):Promise<State>
setState, nothing of the previous state
survives. onStateChanged does fire —
with the new state and the state before the replacement. Connected
clients subscribed to the state stream receive the replacement as a
full snapshot — no broadcast call needed.
Parameters
Returns
Promise<State>
next, as written.