This controller can be put on body or any other element.
- Adds a websocket accessor to the element
- Controller exposes a
connectedboolean getter - Controller bails with a warning if no shared consumer is available
- Element will have
data-action-cable-connectedordata-action-cable-disconnectedattributes which can be used for CSS selectors - Element will emit
action-cable:connectedoraction-cable:disconnectedevents 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.