traceInvalidation: Print the call stack that caused invalidation

Description Usage Arguments Value See Also Examples

View source: R/trace-invalidation.R

Description

Prints the call stack that caused a reactive context to be invalidated. The most recent call is printed first.

Usage

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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()

traceInvalidation(rx)

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