mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Simplify function naming
This commit is contained in:
@@ -108,12 +108,10 @@ ReactiveEnvironment <- R6Class(
|
||||
}
|
||||
return(.currentContext)
|
||||
},
|
||||
runWith = function(ctx, func) {
|
||||
runWith = function(ctx, contextFunc) {
|
||||
old.ctx <- .currentContext
|
||||
.currentContext <<- ctx
|
||||
on.exit(.currentContext <<- old.ctx)
|
||||
# Rename to assist debugging
|
||||
contextFunc <- func
|
||||
shinyCallingHandlers(contextFunc())
|
||||
},
|
||||
addPendingFlush = function(ctx, priority) {
|
||||
|
||||
@@ -487,16 +487,13 @@ Observer <- R6Class(
|
||||
.destroyed = logical(0),
|
||||
.prevId = character(0),
|
||||
|
||||
initialize = function(func, label, suspended = FALSE, priority = 0,
|
||||
initialize = function(observerFunc, label, suspended = FALSE, priority = 0,
|
||||
domain = getDefaultReactiveDomain(),
|
||||
autoDestroy = TRUE) {
|
||||
if (length(formals(func)) > 0)
|
||||
if (length(formals(observerFunc)) > 0)
|
||||
stop("Can't make an observer from a function that takes parameters; ",
|
||||
"only functions without parameters can be reactive.")
|
||||
|
||||
# New name to assist debugging
|
||||
observerFunc <- func
|
||||
|
||||
.func <<- function() {
|
||||
tryCatch(
|
||||
observerFunc(),
|
||||
|
||||
Reference in New Issue
Block a user