reactive() declares a state field of a custom widget (see
widget()). Reading the field returns its value; assigning a different
value (self$count <- self$count + 1L) invalidates the widget and
schedules a repaint. Repaints are batched: any number of assignments in
one event-loop tick produce a single render and a single screen diff.
Examples
reactive(0L)
#> <reactive 0>
reactive("", watch = function(self, value, old) message("now ", value))
#> <reactive "" (watched)>