Skip to content

Shiny reactivity: add slide introducing what is reactivity #4

@daattali

Description

@daattali

I think that before jumping into what the input$ list is, it's a good idea to quickly define what reactivity is and show a small example. This could help make the rest of the concept a bit clearer to people who have never heard of this before.

I suggest making the first slide in lesson 5 as follows:


Reactivity 101

  • When value of variable x changes, anything that relies on x is re-evaluated

  • Contrast with regular R:

x <- 5
y <- x + 1
x <- 10
# What is y? 6 or 11?

Show this slide, talk about how in R we are used to thinking that in this code, when x changes y is unaffected. Then say that if x and y are reactive variables, then y reacts to x changing and gets updated as well, so in a reactive world, such as shiny, y would now be 11. This is what reactivity means in a very broad simplification.

If you don't like this idea, feel free to ignore :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions