Skip to content

Added refresh rate#6

Open
jdtrat wants to merge 2 commits intomainfrom
implement-debounce
Open

Added refresh rate#6
jdtrat wants to merge 2 commits intomainfrom
implement-debounce

Conversation

@jdtrat
Copy link
Owner

@jdtrat jdtrat commented Mar 17, 2021

Added functionality for debouncing and/or manually sending the editor's contents to Shiny re: #1

@jdtrat
Copy link
Owner Author

jdtrat commented Mar 17, 2021

The new refresh_rate argument can be tested with the following code (assuming devtools::load_all() was run).

library(shiny)
ui <- fluidPage(
  br(),
  mdInput(inputId = "one", refresh_rate = "manual", height = "360px", hide_mode_switch = F),
  br(),
  mdInput(inputId = "two", refresh_rate = 500, height = "360px", hide_mode_switch = F)
)

server <- function(input, output, session) {
  
  # Print the markdown version of what is typed
  observe({print(input$one_markdown)})
  
  # Print the HTML version of what is typed
  observe({print(input$one_html)})
  
  # Print the markdown version of what is typed
  observe({print(input$two_markdown)})
  
  # Print the HTML version of what is typed
  observe({print(input$two_html)})
  
}

shinyApp(ui, server)

}

A screenshot from the above app:
Screen Shot 2021-03-16 at 10 18 14 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant