Sharing App State Between Shiny modules
summary
Compares the usual functional pattern of returning reactives between modules with an R6 state manager pattern that passes manager objects (examples: data, user, DB managers) into modules. Implements a variables manager with X/Y fields, a set_variables method and a triggering_plot method to reduce unnecessary reactivity. Provides an MS housing example and production-style repos; approach lets tests target class logic, scales better than a single global reactive store, and is already applied in larger client apps (code on GitHub).
AI-written summary · about
chapters (16)
- 0:00Introduction and speaker intro
- 1:30Why modules and this talk
- 2:15Agenda and module basics
- 5:52Modules recap and benefits
- 8:44Module independence and reuse
- 10:49Standard functional approach
- 15:45Object-oriented approach with managers
- 18:15State manager R6 class
- 21:30Variable selection module
- 24:41Managers vs global reactive values
- 25:44Benefits at scale and testing
- 26:50Common manager types
- 27:54Shiny decisions examples
- 29:24Resources and conclusion
- 30:06Q&A on module size
- 31:50Q&A on module server syntax
