Prints the call stack that caused a reactive context to be invalidated. The most recent call is printed first.
traceInvalidation(x = getCurrentContext(), graph = getReactGraph(), n = 1, value = TRUE, quiet = FALSE, file = "", append = FALSE)
x | A reactive context, expression, observer. Defaults to the current reactive context. |
---|---|
graph | A reactive graph. Defaults to the reactive graph for the current Shiny session. |
n | Number of invalidations to trace back. Defaults to 1, the most recent invalidation. |
value | If |
quiet | If |
file | A filename or connection to print to. Defaults to |
append | If |
A list (stack) of reactive graph nodes.
library(shiny) options(shiny.reactlog = TRUE) val <- reactiveVal(1, label = "val") rx <- reactive({ val() }) observe({ traceInvalidation() rx() }) observe(val(10)) # trigger flush event (happens automatically in a Shiny app) shiny:::flushReact()#> 4: observe({ #> traceInvalidation() #> rx() #> }) #> 3: rx [<text>#7] #> 2: val => num 10 #> 1: observe(val(10))traceInvalidation(rx)#> 3: rx [<text>#7] #> 2: val => num 10 #> 1: observe(val(10))