Skip to contents

Safely wrap expression x such that shiny application does no hang when when the expression raises error.

Usage

safe_observe(
  x,
  env = NULL,
  quoted = FALSE,
  priority = 0L,
  domain = NULL,
  ...,
  error_wrapper = c("none", "notification", "alert"),
  watch_data = getOption("ravedash.auto_watch_data", FALSE)
)

Arguments

x, env, quoted, priority, domain, ...

passed to observe

error_wrapper

handler when error is encountered, choices are 'none', 'notification' (see error_notification), or 'alert' (see error_alert)

watch_data

whether to invalidate only when watch_data_loaded is TRUE

Value

'shiny' observer instance

Examples


values <- shiny::reactiveValues(A=1)

obsB <- safe_observe({
  print(values$A + 1)
})