A convenience function to check whether an object is currently using its
default value. A method is implemented for validated_reactive_val()
objects.
Examples
vrv <- validated_reactive_val(
value = "good",
default = "default",
validation_expr = {
if (.vrv() == "bad") {
rlang::abort("is bad")
}
.vrv()
}
)
shiny::isolate(vrv())
#> [1] "good"
shiny::isolate(is_default(vrv))
#> [1] FALSE
vrv("bad")
shiny::isolate(vrv())
#> [1] "default"
shiny::isolate(is_default(vrv))
#> [1] TRUE