Skip to content

Commit

Permalink
feat: make server more robust to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Feb 6, 2024
1 parent 8159704 commit 86345bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions app/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ ui <- shiny::fluidPage(
server <- function(input, output, session) {

data <- shiny::reactive({

req(input$last_updated, input$created, input$stars, input$language)

dat |>
dplyr::filter(
Expand All @@ -137,7 +139,7 @@ server <- function(input, output, session) {

})

observeEvent(data(), {
observeEvent(list(data()), {

dat <- data()

Expand All @@ -164,9 +166,15 @@ server <- function(input, output, session) {
max = max(dat$stargazers),
value = 0
)

reactable::updateReactable(
"table",
data = dat
)

}, ignoreInit = TRUE)

output$table <- reactable::renderReactable({ # DT::renderDT({
output$table <- reactable::renderReactable({

out <- data()

Expand Down Expand Up @@ -235,17 +243,6 @@ server <- function(input, output, session) {

})

shiny::observeEvent(list(
data(),
input$last_updated,
input$created,
input$stars,
input$language
), {
reactable::updateReactable(
"table"
)
})
}

# Run the application
Expand Down
4 changes: 2 additions & 2 deletions app/rsconnect/shinyapps.io/jimsshinyapps/jimsghstars.dcf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ account: jimsshinyapps
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 6450709
bundleId: 8226928
bundleId: 8226941
url: https://jimsshinyapps.shinyapps.io/jimsghstars/
asMultiple: FALSE
asStatic: FALSE
ignoredFiles: data/2021-09-21-jimbrig-github-starred-repos.qs|deploy.R|deps.yaml|Dockerfile|generate_stars.R
ignoredFiles: deploy.R|deps.yaml|Dockerfile|generate_stars.R

0 comments on commit 86345bb

Please sign in to comment.