Skip to content

Instantly share code, notes, and snippets.

@bezany
Last active April 13, 2017 13:51
Show Gist options
  • Save bezany/12d2601155003f03e9cc7309a8269639 to your computer and use it in GitHub Desktop.
Save bezany/12d2601155003f03e9cc7309a8269639 to your computer and use it in GitHub Desktop.
Shiny observe in observer problem and example correct work
library(shiny)
ui <- fluidPage(
radioButtons(inputId = "userLogged", label="User Logged", choices = c("Yes", "No")),
actionButton("btnSave", "Save")
)
options(shiny.reactlog=TRUE)
server <-function(input, output, session) {
observeEvent(input$btnSave,{
req(input$userLogged == "Yes");
print(input$userLogged);
print("click when logged!");
});
}
shinyApp(ui = ui, server = server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment