mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-10 14:45:12 -05:00
- makeReactiveBinding: Turns a "regular" variable into a reactive. No need to use reactiveValues() for simple reactivity. - setAutoflush (not exported): Causes flushReact() to be called each time something is executed at the R console top-level. - options(shiny.suppressMissingContextError=TRUE): Prevents the "Operation not allowed without an active reactive context" error when attempting to read a reactive value or expression from the console.
35 lines
781 B
R
35 lines
781 B
R
\name{makeReactiveBinding}
|
|
\alias{makeReactiveBinding}
|
|
\title{Make a reactive variable}
|
|
\usage{
|
|
makeReactiveBinding(symbol, env = parent.frame())
|
|
}
|
|
\arguments{
|
|
\item{symbol}{A character string indicating the name of
|
|
the variable that should be made reactive}
|
|
|
|
\item{env}{The environment that will contain the reactive
|
|
variable}
|
|
}
|
|
\value{
|
|
None.
|
|
}
|
|
\description{
|
|
Turns a normal variable into a reactive variable, that
|
|
is, one that has reactive semantics when assigned or read
|
|
in the usual ways. The variable may already exist; if so,
|
|
its value will be used as the initial value of the
|
|
reactive variable (or \code{NULL} if the variable did not
|
|
exist).
|
|
}
|
|
\examples{
|
|
\dontrun{
|
|
a <- 10
|
|
makeReactiveBinding("a")
|
|
b <- reactive(a * -1)
|
|
observe(print(b))
|
|
a <- 20
|
|
}
|
|
}
|
|
|