Understanding reactive expressions
One of the central tenets of reactivity is that reactive expressions are executed lazily, and their values are cached.
- Lazy: Evaluated only when it is called, typically by a reactive endpoint.
- Cached: Evaluated only when the value of one of its underlying dependencies changes.
Consider the Shiny app shown on the right. How many times do you think the following two messages will get printed:
Computing cars_1 ...Computing cars_2 ...
Questo esercizio fa parte del corso
Building Web Applications with Shiny in R
Esercizio pratico interattivo
Passa dalla teoria alla pratica con uno dei nostri esercizi interattivi
Inizia esercizio