소스 검색

Refactor into resetTypingSpeed()

shiny-input
Garrick Aden-Buie 6 년 전
부모
커밋
644a8b6c2e
2개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      inst/shiny-input-app/app.R
  2. +6
    -0
      inst/shiny-input-app/dev-shiny-input.Rmd

+ 5
- 1
inst/shiny-input-app/app.R 파일 보기

) )
} }


resetTypingSpeed <- function(inputId, session = getDefaultReactiveDomain()) {
session$sendInputMessage("typing", TRUE)
}

ui <- fluidPage( ui <- fluidPage(
# textAreaInput("typing", "Type here..."), # textAreaInput("typing", "Type here..."),
typingSpeedInput("typing", "Type here..."), typingSpeedInput("typing", "Type here..."),
output$debug <- renderPrint(input$typing) output$debug <- renderPrint(input$typing)


observeEvent(input$reset, { observeEvent(input$reset, {
session$sendInputMessage("typing", TRUE)
resetTypingSpeed("typing")
}) })
} }



+ 6
- 0
inst/shiny-input-app/dev-shiny-input.Rmd 파일 보기

whenever the button is clicked. whenever the button is clicked.


`r github_sha_link("269e4ebdc48a66ecf7466192076c4fa259582cc6")` `r github_sha_link("269e4ebdc48a66ecf7466192076c4fa259582cc6")`

Once you get that working,
refactor it into a `resetTypingSpeed()` function.

This function should take an `inputId` and a `session` object.
Use `shiny::getDefaultReactiveDomain()` for the default `session` value.

Loading…
취소
저장