A closer look at reactivity

So far, we have discussed reactive programming and how Shiny implements its features. We'll now take a closer look at how this works. RShiny uses a pull mechanism instead of a push mechanism. This means whenever the output senses that there is a change in input, it pulls the new values from the input. In push mechanisms, output values are pushed for every input change. Pull mechanisms are also known as lazy-evaluation mechanisms. This simply means that they are not like input to output electricity transfers, but more like pigeon-carrier methods.

Shiny implements reactivity with two special object classes:

  • Reactive values, which, as we have seen, can be printed as input$value
  • Observer, which can be printed as ...

Get Web Application Development with R Using Shiny - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.