inst/apps/061-server-to-client-custom-messages/server.R

function(input, output, session) {
  # An observer is used to send messages to the client.
  # The message is converted to JSON
  observe({
    session$sendCustomMessage(type = 'testmessage',
      message = list(a = 1, b = 'text',
                     controller = input$controller))
  })
}
rstudio/shinycoreci documentation built on April 11, 2025, 3:17 p.m.