Create a 'reactive trigger' object (not a proper R class) with two methods:
depend()
: must be written in a code chunk to execute on triggering
trigger()
: when executed, trigger the object (and all the "depending"
code chunks)
This function is freely re-used from Dean Attali's work:
See here.
Usage
make_reactive_trigger(dev = FALSE, label = "")
Arguments
- dev
logical; if TRUE, will print messages to console
- label
character; label for the trigger
Value
list with two functions: depend()
and trigger()
Examples
# create a reactive trigger
trigger <- make_reactive_trigger(dev = TRUE, label = "my_trigger")