listDependencies: List reactive dependencies

Description Usage Arguments Value See Also Examples

View source: R/list-dependencies.R

Description

Shows a tree view of reactive dependencies.

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()

listDependencies(obs, depth = 0, srcref = TRUE)

## Not run: 
# show the entire dependency tree
listDependencies()

## End(Not run)

glin/reactlog documentation built on May 29, 2019, 5:58 p.m.