Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashbaldry/shiny.destroy
Safely remove dynamic shiny modules
https://github.com/ashbaldry/shiny.destroy
r shiny
Last synced: about 1 month ago
JSON representation
Safely remove dynamic shiny modules
- Host: GitHub
- URL: https://github.com/ashbaldry/shiny.destroy
- Owner: ashbaldry
- License: other
- Created: 2024-05-08T16:31:29.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:53:41.000Z (3 months ago)
- Last Synced: 2024-09-17T22:57:39.009Z (3 months ago)
- Topics: r, shiny
- Language: R
- Homepage: https://ashbaldry.github.io/shiny.destroy/
- Size: 399 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ashbaldry/shiny.destroy - Safely remove dynamic shiny modules (R)
README
# shiny.destroy
[![R-CMD-check](https://github.com/ashbaldry/shiny.destroy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ashbaldry/shiny.destroy/actions/workflows/R-CMD-check.yaml)
The aim of {shiny.destroy} is to allow inputs and modules created in a shiny application to be removed without keeping any trace of them within the realm of the shiny application.
## Installation
Install the latest version of {shiny.destroy} on GitHub
```r
require("remotes")
remotes::install_github("ashbaldry/shiny.destroy")
```## Usage
There are two types of objects that {shiny.destroy} handles: inputs and modules.
### Input
Use the function `removeInput` to remove the desired input. This is a wrapper around `shiny::removeUI`, but includes ways to reference the input server-side, and updates any reactives and/or outputs that depend on that input instantly.
### Module
Prior to the application loading.
## Example
![Example shiny.destroy application](./man/figures/example_app.gif)
The code for this example is available in the [examples directory](/inst/examples-shiny)
## Limitations
To include sub-modules within the destroyable module, the server-side module will need to be passed through `makeModuleServerDestroyable` and included as an argument to the parent module to ensure those observers are safely removed.