# NOT RUN {
# A very simple render function
renderTriple <- function(x) {
x <- substitute(x)
if (!rlang::is_quosure(x)) {
x <- rlang::new_quosure(x, env = parent.frame())
}
func <- quoToFunction(x, "renderTriple")
createRenderFunction(
func,
transform = function(value, session, name, ...) {
paste(rep(value, 3), collapse=", ")
},
outputFunc = textOutput
)
}
# Test render function from the console
a <- 1
r <- renderTriple({ a + 1 })
a <- 2
r()
# }
Run the code above in your browser using DataLab