Shows a tree view of reactive dependencies.

listDependencies(x = getCurrentContext(), graph = getReactGraph(),
  invalidated = FALSE, depth = NULL, status = TRUE, value = FALSE,
  srcref = FALSE, 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.

invalidated

If TRUE, get the last invalidated context.

depth

Max depth of the dependency tree to display.

status

If TRUE, show status markers.

value

If TRUE, show values of reactive values.

srcref

If TRUE, show source references.

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 nested list of dependencies.

See also

traceInvalidation()

Examples

library(shiny) options(shiny.reactlog = TRUE) valA <- reactiveVal(1, label = "valA") valB <- reactiveVal(2, label = "valB") rxA <- reactive({ valA() }) rxB <- reactive({ valB() }) rxAB <- reactive({ valA() + valB() }) obs <- observe({ listDependencies() rxA() + rxB() + rxAB() }, label = "obs") observe(valA(3)) # trigger flush event (happens automatically in a Shiny app) shiny:::flushReact()
#> obs* #> +-- rxA* #> | `-- valA* #> +-- rxB #> | `-- valB #> `-- rxAB* #> +-- valA* #> `-- valB
listDependencies(obs, depth = 0, srcref = TRUE)
#> obs #> +-- rxA [<text>#8] #> +-- rxB [<text>#12] #> `-- rxAB [<text>#16]
# NOT RUN { # show the entire dependency tree listDependencies() # }