Skip to content

Commit

Permalink
Cleaner method of getting execCount
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Aug 29, 2014
1 parent 11dfa3d commit 3f34030
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/reactives.R
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ is.reactive <- function(x) inherits(x, "reactive")

# Return the number of times that a reactive expression or observer has been run
execCount <- function(x) {
if (is.function(x))
return(environment(x)$.execCount)
if (is.reactive(x))
return(attr(x, "observable")$.execCount)
else if (inherits(x, 'Observer'))
return(x$.execCount)
else
Expand Down

0 comments on commit 3f34030

Please sign in to comment.