Reactive programming

At the heart of Shiny is a reactive programming engine. So far we’ve seen some very basic reactive programming. When a (reactive) input is modified, it causes a (reactive) output function to re-execute. Shiny does this automatically; you don’t need to explicitly tell it that a function should re-execute when a particular value changes.

In this section, we’ll learn more about reactivity, and more complex programs that can be built with reactive programming.

There are a few utility functions that help with managing reactivity:

Shiny for Python compared to R

If you already know Shiny for R, you’ll notice that we’ve used some different names in Python.

  • A shiny::observe() in R is equivalent to a reactive.Effect in Python.
  • A shiny::reactive() in R is equivalent to a reactive.Calc in Python.