Skip to content

Instantly share code, notes, and snippets.

View dwill023's full-sized avatar

Desiree Williams dwill023

View GitHub Profile

Reactive triggers

Good use cases for reactive triggers.

  • expensive or time-consuming process: Instead of automatically recalculating data whenever an input changes, you might want to let users decide when to update an expensive or time‐consuming computation (e.g., querying an external API). A reactive trigger lets you decouple the immediate input change from the computation, giving the user control over when the data is refreshed.
  • Batch Updating: In scenarios where several inputs might change in quick succession, you may not want each change to individually trigger a recalculation. Instead, you can wait until all inputs are set (perhaps with a "Submit" or "Apply Changes" button) and then use a reactive trigger to perform a single, coordinated update.
  • Conditional Recalculation: update only under certain conditions. Using a trigger lets you isolate the reactivity to those conditions rather than having it automatically tied to every related input.
  • Periodic or Scheduled Updates: You can
@dwill023
dwill023 / index.md
Created August 14, 2024 18:07 — forked from jcheng5/index.md
Resources for "Shiny × AI" by Joe Cheng, at posit::conf(2024)