Skip to contents

Remove variables from the user data environment of a Shiny session.

Usage

shiny_unsetenv(nms, session = shiny::getDefaultReactiveDomain())

Arguments

nms

A character vector of names.

session

A Shiny session object. Defaults to the current session.

Value

The modified user data environment, invisibly.

Examples

session <- rlang::env(
  userData = rlang::env(foo = "bar", baz = "foo", bar = "baz")
)
shiny_unsetenv(c("foo", "baz"), session = session)
names(session$userData)
#> [1] "bar"