I think there's an opportunity to do something better for WebSocket + Shiny eventually, to have a more reactivity-oriented (rather than event-oriented) API that you can opt for. But this at least proves that the two do work together just fine.
(The event handlers don't have a reactive domain, that threw me for a little bit as shinyjs::toggleState expects them and doesn't give you a way to pass them in explicitly)
I think there's an opportunity to do something better for WebSocket + Shiny eventually, to have a more reactivity-oriented (rather than event-oriented) API that you can opt for. But this at least proves that the two do work together just fine.
(The event handlers don't have a reactive domain, that threw me for a little bit as
shinyjs::toggleState
expects them and doesn't give you a way to pass them in explicitly)