checkReactivityPrerequisites: Check Prerequisits for Setting Reactive Objects (generic)

Description Usage Arguments Author(s) References See Also Examples

Description

Checks prerequisites to determine if its valid to set the reactive object as desired. This decision is influenced by the level of strictness that is imposed via strict.

Usage

1
checkReactivityPrerequisites(input = NULL, strict = 0, ...)

Arguments

input

Signature argument. Object containing a suitable object for the check. Typically, this corresponds to the instance of class ReactiveObject.S3.

strict

numeric. Relevant when initially setting a reactive object

  • 0: no checks are performed

  • 1: warning if object is already a non-reactive or reactive object or if any references does not exist yet

  • 2: error if object is already a non-reactive or reactive object or if any references do not exist yet

...

Further arguments to be passed to subsequent functions/methods.

Author(s)

Janko Thyson janko.thyson@rappster.de

References

http://github.com/Rappster/reactr

See Also

checkReactivityPrerequisites-ReactiveObject.S3-method, setReactive

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 

## NOTE
## This function has a strong internal character as it is mainly designed to 
## be used inside of 'setReactive()'.
## Thus not all aspects can be properly illustrated if the function is not 
## used in its default context

## Start with a fresh registry state //
resetRegistry()

suppressWarnings(rm(x_1))
input <- reactr::ReactiveObject.S3(
  id = "x_1",
  value = 10
)

## Error reason: object does not exist yet //
try(checkReactivityPrerequisites(input = input, strict = 2))

## Error reason: object exists but is non-reactive //
x_1 <- 10
try(checkReactivityPrerequisites(input = input, strict = 2))

## Error reason: reactive object already exists //
## This cannot be illustrated outside the context of 'setReactive()'

## All prerequisites met //
checkReactivityPrerequisites(input = input)


## End(Not run)

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