| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/reactives.R |
| 3 |
\name{makeReactiveBinding} |
| 4 |
\alias{makeReactiveBinding} |
| 5 |
\title{Make a reactive variable} |
| 6 |
\usage{ |
| 7 |
makeReactiveBinding(symbol, env = parent.frame()) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{symbol}{Name of variable to make reactive, as a string.} |
| 11 |
|
| 12 |
\item{env}{Environment in which to create binding. Expert use only.} |
| 13 |
} |
| 14 |
\value{ |
| 15 |
None. |
| 16 |
} |
| 17 |
\description{ |
| 18 |
Turns a normal variable into a reactive variable, that is, one that has |
| 19 |
reactive semantics when assigned or read in the usual ways. The variable may |
| 20 |
already exist; if so, its value will be used as the initial value of the |
| 21 |
reactive variable (or \code{NULL} if the variable did not exist). |
| 22 |
} |
| 23 |
\examples{ |
| 24 |
reactiveConsole(TRUE) |
| 25 |
|
| 26 |
a <- 10 |
| 27 |
makeReactiveBinding("a") |
| 28 |
|
| 29 |
b <- reactive(a * -1) |
| 30 |
observe(print(b())) |
| 31 |
|
| 32 |
a <- 20 |
| 33 |
a <- 30 |
| 34 |
|
| 35 |
reactiveConsole(FALSE) |
| 36 |
} |
| 37 |
\keyword{internal} |