This is used to allow parameters to Shiny functions to be optionally reactive.
ensure_reactive(item, name = NULL, env = NULL, default = function() stop("Missing ", name))
item | Thing to ensure reactive, either an already reactive value, or a plain value, or NULL. |
---|---|
name | If item is NULL, env[[name]]() will be used. |
env | If item is NULL, env[[name]]() will be used. |
default | If item is NULL, and name is not in env, this reactive value will be used. |
A Shiny reactive value.