mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-01 10:15:05 -05:00
21 lines
647 B
R
21 lines
647 B
R
# Keeps the context associated with a ShinySession reference object for the
|
|
# duration of a request. Used to emit reactive evaluation information to the
|
|
# appropriate session when showcase mode is enabled.
|
|
|
|
.sessionContext <- new.env(parent=emptyenv())
|
|
.beginShowcaseSessionContext <- function(session) {
|
|
assign("session", session, envir = .sessionContext)
|
|
}
|
|
|
|
.endShowcaseSessionContext <- function() {
|
|
if (exists("session", where = .sessionContext))
|
|
remove("session", envir = .sessionContext)
|
|
}
|
|
|
|
.getShowcaseSessionContext <- function() {
|
|
if (exists("session", where = .sessionContext))
|
|
.sessionContext$session
|
|
else
|
|
NULL
|
|
}
|