This controller can be put on body or any other element.
- Adds a websocket accessor to the element
- Controller exposes a
connected
boolean getter - Controller bails with a warning if no shared consumer is available
- Element will have
data-action-cable-connected
ordata-action-cable-disconnected
attributes which can be used for CSS selectors - Element will emit
action-cable:connected
oraction-cable:disconnected
events only when state is flipping - Errors => Disconnected to keep things simple
I intend to document the navigator.onLine
accessor and the window:online/offline
events so devs can handle PWA modes.