Simplify function naming

This commit is contained in:
Winston Chang
2015-10-23 15:48:33 -05:00
parent 2dacc6ce40
commit 49eba95a9c
2 changed files with 3 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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(),