To evaluate the (reactive) values,
the function walks down the tree of return values
and rlang::exec()
s all the shiny::is.reactive()
s it can find,
going until it hits a non-list (is.list()
) that is also not a reactive.
Usage
mixed_react_tree_app(...)
mixed_react_tree_ui(id)
mixed_react_tree_server(id, tree = shiny::reactive(NULL))
Arguments
- ...
Arguments passed on to
module2app
module_ui,module_server
Module functions.
ui_args,server_args
Additional arguments passed to
module_server
andmodule_ui
.server_args
can beshiny::reactive()
s, if corresponding argument inmodule_server
accepts it.ui_wrapper
A function to wrap the resulting
shiny::tagList()
in. Must yield a full shiny UI, such asshiny::basicPage()
orshiny::bootstrapPage()
. For maximum reusability of a module, avoid depending on the wrapper and only return "vanilla" UI.options
Named options that should be passed to the
runApp
call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specifywidth
andheight
parameters which provide a hint to the embedding environment about the ideal height/width for the app.
- id
The id string to be namespaced (optional).
- tree
A reactive- or non-reactive value, typically a deeply nested list of reactives and non-reactive values, as passed around between modules.
Details
In the simplest case, modules accept or return a single reactive- or non-reactive value. Non-reactive returns are uncommon, but allowed. In a more complex case, modules can accept or return deeply nested lists of reactives and non-reactives, including non-reactives which contain reactives. For example, consider a module to input the contact details of an arbitrary number of people, say, a travel group.
To quickly grasp what your module accepts and returns, this module prints both the "raw", unevaluated tree and a version of the tree with all leaves evaluated.
Functions
mixed_react_tree_app()
: Test appmixed_react_tree_ui()
: Module UImixed_react_tree_server()
: Module Server
Changes to the Reactive Graph
Note that because this module prints all returned reactives from the tree to the UI, the reactive graph will be deeply affected. For example, these reactives might be invalidated at a different time in your use of your modules outside of this testbed.
See also
Other modules:
abort_if_reactive()
,
get_screenshot_args_attr()
,
module2app()