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)
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 |
depth | Max depth of the dependency tree to display. |
status | If |
value | If |
srcref | If |
quiet | If |
file | A filename or connection to print to. Defaults to |
append | If |
A nested list of dependencies.
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* #> `-- valBlistDependencies(obs, depth = 0, srcref = TRUE)#> obs #> +-- rxA [<text>#8] #> +-- rxB [<text>#12] #> `-- rxAB [<text>#16]# NOT RUN { # show the entire dependency tree listDependencies() # }