Skip to content

url_search parsing a shinylive app #28

@thebioengineer

Description

@thebioengineer

I have an app from my screencast that I tried to turn into a shinylive app that takes advantage of session$clientData$url_search to pull in the query params from a user. Once I used shinylive to convert it, the queries passed to the URL did get passed onto the shinylive shiny session.

Not sure how large of use-case this is, but I would imagine some folks might want bookmarking to function so flagging for your attention.

library(shiny)

ui <- fluidPage(
  textOutput("time"),
  textOutput("search_values")
)

server <- function(input, output, session){

  ## Update timeVal every second with current time
  timeVal <- reactivePoll(1000, session,
                          checkFunc = function() {
                            Sys.time()
                          },
                          # This function returns the content of log_file
                          valueFunc = function() {
                            Sys.time()
                          }
  )

  output$time <- renderText({
    format(timeVal(),"%m-%d-%Y %H:%M:%S")
  })

  search <- reactive({
      timeVal()
      session$clientData
  })

  output$search_values <- renderText({
    format(search())
  })

}

shinyApp(ui, server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions