rx_value: Reactive value

Description Usage Arguments Value Examples

View source: R/simple.R

Description

Creates a reactive value object, whose value can be read (reactively) and set. Setting the value invalidates any reactive conductors or endpoints that had read the previous value (unless the new value is identical to the previous value, in which case nothing happens).

Usage

1
rx_value(initial_value = NULL)

Arguments

initial_value

The starting value of the reactive value object.

Value

A function. To read the reactive value, call it with no arguments. To set the reactive value, call it with the desired value as an argument.

Examples

1
2
3
4
5
6
7
a <- rx_value(10)

r <- rx_calc({
  a()  # read the value
})

a(20)  # set the value

jcheng5/rxtools documentation built on May 18, 2019, 10:22 p.m.