Exercises

  1. Design and perform a small experiment to verify that reactiveVal() also has reference semantics.
# If we define 3 objects
x <- reactiveVal(1)
y <- x
z <- reactiveVal(1)

# If we change the value of x
x(2)

# Then y also changes
x()
## [1] 2
y()
## [1] 2
# But z keeps the same
z()
## [1] 1