posit-dev / posit-dev/shinylive

bindEvent and bindCache not working in shinylive

Open
#132 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
251
Forks
25
Avg merge
19m
Merged PRs (30d)
2

Description

The provided code includes the usage of bindEvent and bindCache functions in a shinyApp, but it seems that they are not functioning as expected in shinylive.

Code snippet:

shinyApp(
    ui = fluidPage(
      sliderInput("x", "x", 1, 10, 5),
      sliderInput("y", "y", 1, 10, 5),
      actionButton("go", "Go"),
      div("x * y: "),
      verbatimTextOutput("txt")
    ),
    server = function(input, output) {
      r <- reactive({
        message("Doing expensive computation...")
        Sys.sleep(2)
        input$x * input$y
      }) %>%
        bindCache(input$x, input$y) %>%
        bindEvent(input$go,once = TRUE)
      output$txt <- renderText(r())
    }
  )

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied shinyApp example in shinylive and compare its bindEvent and bindCache behavior with regular Shiny. Trace the reactive expression and output rendering involved in the example; done means the example behaves as expected when the action button and cached inputs are used.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, wasm
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.