suppressMessages(require("reactr"))
resetRegistry()

Whenever a reactive object is set via setReactive(), the object that is actually created is an instance of class ReactiveObject.S3 even though it does not appear so: the instance itself remains invisible and only the value of its field value is made visible to the user/system and can thus subsequently be accessed and manipulated through the name/ID provided in id in the call to setReactive()

setReactive(id = "x_1", 10)
x_1
class(x_1)

Usually, due to the way makeActiveBinding() works, we would not be able to access this hidden object once the function returns as it is only stored internally. In order to keep the object accessible, setReactive() stores it in an internal registry.

The registry can be accessed via

getOption("reactr")$.registry

or via the convenience function getRegistry()

registry <- getRegistry()

As mentioned, the actual content consists of the respective invisible objects that were created in the call to setReactive() which are assigned to names that correspond to the UIDs of its visible parts

ls(registry)
x_1_hidden <- getFromRegistry(id = "x_1")
x_1_hidden
class(x_1_hidden)


rappster/reactr documentation built on May 26, 2019, 11:56 p.m.