insertUI Process

  1. Sent html by Json to Javascript.
ShinySession <- R6Class(
  'ShinySession',
  private = list(
    sendInsertUI = function(selector, multiple, where, content) {
      private$sendMessage(
        `shiny-insert-ui` = list(
          selector = selector,
          multiple = multiple,
          where = where,
          content = content
        )
      )
    },
    sendMessage = function(...) {
      # This function is a wrapper for $write
      msg <- list(...)
      if (any_unnamed(msg)) {
        stop("All arguments to sendMessage must be named.")
      }
      private$write(toJSON(msg))
    }
  )
)