Skip to contents

Creates a shiny::reactiveValues object pre-loaded with artist and artwork context for module development and standalone testing. This is the standard way to initialize reactive state in module run_app() functions.

Replaces the deprecated artutils::reactiveAppData() function with a snake_case equivalent that lives in the appropriate package layer.

Usage

reactive_appdata(artist, artwork = NULL, cn = NULL)

Arguments

artist

Character. Artist UUID.

artwork

Character. Artwork UUID. If NULL, a random artwork from the artist's portfolio is selected (useful for development/demo).

cn

Database connection. If NULL, opens and closes automatically.

Value

A shiny::reactiveValues object with:

artist

Artist UUID (character)

artwork

Artwork UUID (character)

appdata

Nested list from artutils::get_appdata() containing artist info, artwork details, paths, config, etc.

Details

This function is designed for module run_app() functions that need to run modules in isolation during development. It provides the same reactive structure that appPlatform provides in production.

The artwork = NULL behavior (random selection) is intentionally kept for development convenience, but should not be used in production code.

See also

artutils::get_appdata() for the underlying data aggregation

Other module-helpers: artshiny-package

Examples

if (FALSE) { # \dontrun{
# In a module's run_app() function
run_app <- function(artist) {
  server <- function(input, output, session) {
    r <- artshiny::reactive_appdata(artist)
    myModuleServer("id", r)
  }
  shiny::shinyApp(ui, server)
}

# With specific artwork
r <- reactive_appdata(
  artist = "746b8207-72f5-4ab6-8d19-a91d03daec3d",
  artwork = "99a61148-1d3b-4340-8cf6-92ad26046b0f"
)
} # }