Use this trick to send values from ui to server in module.

var_to_server(id, values)

Arguments

id

The input variable to read value from.

values

The values need to be sent.

Value

The hidden selectInput object.

Examples

if (FALSE) {
widgetUI <- function(id) {
  ns <- NS(id)
  items <- c("chicken", "egg")
  var_to_server(ns("items"), items)
}

widgetServer <- function() {
  moduleServer(
    id,
    function(input, output, session) {
      # items now can be read in the server
      purrr::map_chr(isolate(input$items), print)
    }
  )
}
}