Fix: avoid a race condition when dispatch is used twice from outside
E.g. websocket open + websocket msg arriving
Application returns a Cmd from update(model, msg)
but the Effect handler is not ran be React 18 before
the websocket msg-arriving is handled by the Reducer.
Result: The Cmd returned by update(model, msg) is dropped silently.
3-in-1
Fix: avoid a race condition when dispatch is used twice from outside
E.g. websocket open + websocket msg arriving Application returns a Cmd from update(model, msg) but the Effect handler is not ran be React 18 before the websocket msg-arriving is handled by the Reducer. Result: The Cmd returned by update(model, msg) is dropped silently.