ensure_reactive: Make a value reactive if it is not already reactive.

View source: R/shiny_util.R

ensure_reactiveR Documentation

Make a value reactive if it is not already reactive.

Description

This is used to allow parameters to Shiny functions to be optionally reactive.

Usage

ensure_reactive(
  item,
  name = NULL,
  env = NULL,
  default = function() stop("Missing ", name)
)

Arguments

item

Thing to ensure reactive, either an already reactive value, or a plain value, or NULL.

name

If item is NULL, env[[name]]() will be used.

env

If item is NULL, env[[name]]() will be used.

default

If item is NULL, and name is not in env, this reactive value will be used.

Value

A Shiny reactive value.


MonashBioinformaticsPlatform/varistran documentation built on June 9, 2025, 8:36 a.m.