e.observe.event: Observe Event with Error Handling

View source: R/shiny.R

e.observe.eventR Documentation

Observe Event with Error Handling

Description

Observe event with erratum error handling.

Usage

e.observe.event(
  eventExpr,
  handlerExpr,
  e = NULL,
  w = NULL,
  event.env = parent.frame(),
  event.quoted = FALSE,
  handler.env = parent.frame(),
  handler.quoted = FALSE,
  ...,
  label = NULL,
  suspended = FALSE,
  priority = 0,
  domain = shiny::getDefaultReactiveDomain(),
  autoDestroy = TRUE,
  ignoreNULL = TRUE,
  ignoreInit = FALSE,
  once = FALSE
)

Arguments

eventExpr

A (quoted or unquoted) expression that represents the event; this can be a simple reactive value like input$click, a call to a reactive expression like dataset(), or even a complex expression inside curly braces

handlerExpr

The expression to call whenever eventExpr is invalidated. This should be a side-effect-producing action (the return value will be ignored). It will be executed within an isolate() scope.

e

Error handler.

w

Warning handler.

event.env

The parent environment for the reactive expression. By default, this is the calling environment, the same as when defining an ordinary non-reactive expression. If eventExpr is a quosure and event.quoted is TRUE, then event.env is ignored.

event.quoted

If it is TRUE, then the quote()ed value of eventExpr will be used when eventExpr is evaluated. If eventExpr is a quosure and you would like to use its expression as a value for eventExpr, then you must set event.quoted to TRUE.

handler.env

The parent environment for the reactive expression. By default, this is the calling environment, the same as when defining an ordinary non-reactive expression. If handlerExpr is a quosure and handler.quoted is TRUE, then handler.env is ignored.

handler.quoted

If it is TRUE, then the quote()ed value of handlerExpr will be used when handlerExpr is evaluated. If handlerExpr is a quosure and you would like to use its expression as a value for handlerExpr, then you must set handler.quoted to TRUE.

...

Currently not used.

label

A label for the observer or reactive, useful for debugging.

suspended

If TRUE, start the observer in a suspended state. If FALSE (the default), start in a non-suspended state.

priority

An integer or numeric that controls the priority with which this observer should be executed. An observer with a given priority level will always execute sooner than all observers with a lower priority level. Positive, negative, and zero values are allowed.

domain

See domains.

autoDestroy

If TRUE (the default), the observer will be automatically destroyed when its domain (if any) ends.

ignoreNULL

Whether the action should be triggered (or value calculated, in the case of eventReactive) when the input event expression is NULL. See Details.

ignoreInit

If TRUE, then, when this observeEvent is first created/initialized, ignore the handlerExpr (the second argument), whether it is otherwise supposed to run or not. The default is FALSE. See Details.

once

Whether this observeEvent should be immediately destroyed after the first time that the code in handlerExpr is run. This pattern is useful when you want to subscribe to a event that should only happen once.


devOpifex/erratum documentation built on Feb. 5, 2024, 1:58 p.m.