Skip to contents

Create a 'reactive trigger' object (not a proper R class) with two methods:

  1. depend() : must be written in a code chunk to execute on triggering

  2. 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")