Aan de slagGa gratis aan de slag

Understanding reactive expressions

One of the central tenets of reactivity is that reactive expressions are executed lazily, and their values are cached.

  1. Lazy: Evaluated only when it is called, typically by a reactive endpoint.
  2. 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:

  1. Computing cars_1 ...
  2. Computing cars_2 ...

Deze oefening maakt deel uit van de cursus

Building Web Applications with Shiny in R

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen