1. Applying reactivity concepts
Now that you've learned the basics of reactivity, let's practice a bit more by applying the concepts.
2. Reactivity 101
It's critical to understand reactivity as you build increasingly complex Shiny apps. Reactivity is the core thing that makes your app responsive and updates the outputs when users make a change to the inputs.
The reactive function is very helpful when you're going to do repeated calculations in your app. Reactives are calculated lazily, so the calculation will only happen once, even if you call a reactive function multiple times. There was an exercise earlier where the reactive function cars_1 was called twice, but the message only prints to the console once!
3. Reactives and observers
Recall that in lesson 2, we walked through the differences between reactive expressions and observers.
There are three key kinds of reactive components: sources, conductors, and endpoints.
Sources can be accessed through input$x.
Conductors are especially helpful to use when doing an especially slow or expensive calculation or computation in your app, and they can be placed between sources and endpoints.
Endpoints are accessed using output$y, and are observers, that are used for their side effects, not to directly calculate anything.
4. Stop, Delay, Trigger
Finally, in lesson 3, you learned how to stop an action with isolate, delay an action with eventReactive, and trigger a side effect with observeEvent. All three are critical functions you'll likely use again and again as you build Shiny apps.
5. Let's practice!
Now, let's go reinforce the concepts behind reactivity with some practice.