This reads very similar to how IMAP is defined (it's not a request/response protocol).
And Websocket seems like an overcomplication of the system as you need a WS-compatible server and broker, it would probably be simpler to use SSE[0][1]. See http://matthiasnehlsen.com/blog/2013/06/23/angularjs-and-pla... for an example of SSE+occasional HTTP calls.
The big difference, of course, is that such a system is not really offlinable, the application is basically frozen as soon as the connection is lost.
[0] even if MSIE doesn't support them, they can be polyfilled even in IE7 and old android browsers
[1] plus SSE has native support for server-configured reconnection timeout, event-ids and custom event types, all that in an ASCII-based format
I'm not _as_ worried about offlinable, to be honest. This post just tickled that part of my brain that had been thinking about React.
Yeah SSE is one of the most interesting APIs people have never heard about, everybody jumped on WS but for many use cases SSE is more than sufficient, much simpler to deploy and use and a much simpler upgrade path from polling.
All requests go to a REST API which only returns head responses, and shoves the actual data response onto a queue. The websocket server reads off the queue and publishes the response to connected clients.
On the client side it's all actions and dispatchers and react components. Keep meaning to write an in depth blog post about that when I get the time.