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)

Arguments

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 TRUE, show changed values of reactive values.

quiet

If TRUE, suppress output.

file

A filename or connection to print to. Defaults to stdout.

append

If TRUE, output will be appended to file.

Value

A list (stack) of reactive graph nodes.

See also

listDependencies()

Examples

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