Skip to contents

Given a component instance tag x, decompose the instance into separate server and UI elements.

Usage

decompose(x)

Arguments

x

a shiny tag returned from calling a component

Value

list

Examples

comp <- component(
   name = "decompose",
   template = function(ns) {
       shiny::div("hello world")
   },
   methods = list(
       setup = function(input, output, session) {
           # noop
       }
   )
)
x <- decompose(comp())
print(x)
#> $server
#> function(input, output, session) {
#>            # noop
#>        }
#> <environment: 0x5641de557320>
#> 
#> $ui
#> <rsx::instance> `decompose`
#>   <div>hello world</div>
#>