mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
Rename flush.react to flushReact
This commit is contained in:
12
R/react.R
12
R/react.R
@@ -323,16 +323,16 @@ Observer <- setRefClass(
|
||||
get('.ReactiveEnvironment', envir=.GlobalEnv, inherits=F)
|
||||
}
|
||||
|
||||
flush.react <- function() {
|
||||
flushReact <- function() {
|
||||
.getReactiveEnvironment()$flush()
|
||||
}
|
||||
|
||||
.test <- function () {
|
||||
values <- Values$new()
|
||||
obs <- Observer$new(function() {print(values$get('foo'))})
|
||||
flush.react()
|
||||
flushReact()
|
||||
values$set('foo', 'bar')
|
||||
flush.react()
|
||||
flushReact()
|
||||
|
||||
values$set('a', 100)
|
||||
values$set('b', 250)
|
||||
@@ -340,9 +340,9 @@ flush.react <- function() {
|
||||
values$get('a') + values$get('b')
|
||||
})
|
||||
obs2 <- Observer$new(function() {print(paste0('a+b: ', observable$getValue()))})
|
||||
flush.react()
|
||||
flushReact()
|
||||
values$set('b', 300)
|
||||
flush.react()
|
||||
flushReact()
|
||||
values$mset(list(a = 10, b = 20))
|
||||
flush.react()
|
||||
flushReact()
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ startApp <- function(app, www.root, sys.www.root=NULL, port=8101L) {
|
||||
msg$method,
|
||||
init = {
|
||||
shinyapp$session$mset(msg$data)
|
||||
flush.react()
|
||||
flushReact()
|
||||
local({
|
||||
input <- .createValuesReader(shinyapp$session)
|
||||
output <- .createOutputWriter(shinyapp)
|
||||
@@ -142,7 +142,7 @@ startApp <- function(app, www.root, sys.www.root=NULL, port=8101L) {
|
||||
update = {
|
||||
shinyapp$session$mset(msg$data)
|
||||
})
|
||||
flush.react()
|
||||
flushReact()
|
||||
shinyapp$flushOutput()
|
||||
}, ws_env)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user