Skip to content

Instantly share code, notes, and snippets.

View hypebright's full-sized avatar

Veerle van Leemput hypebright

View GitHub Profile
@hypebright
hypebright / gargoyle_minimal_example.R
Created December 11, 2022 16:04
gargoyle example using init, trigger and watch
library(shiny)
library(gargoyle)
ui <- function(){
tagList(
actionButton("go", "Show me"),
h4('Output of pass_around$data'),
tableOutput("table")
)
}
@hypebright
hypebright / shiny-destroy-observer.R
Created March 9, 2024 16:54
Demo demonstrating how to dynamically add and remove Shiny modules, and how to properly clean up modules once removed by using the destroy() method.
# Dynamic UI: demonstrate destroy() method on observer
# This example makes use of a module that dynamically creates pages
# Each server part of the module creates an observer that listens to an actionButton
# Whenever a page is removed, the observer is destroyed. The UI is removed with
# the nav_remove() function.
library(shiny)
library(bslib)
sportsPageUI <- function(id, page_name) {