You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More of a design question, this won't hold up a JOSS review. On of the major design tools in shiny is using reactive objects to avoid having complex server functions. Right now the server functions look like this:
While this is functioning fine, generally it is a good idea to separate the derivation of your objects from the server function and use the req function instead of something like input$button > 0. So the functionality would become something like this:
server <- function(input, output) {
<filepaths, input data, etc>
# deriveDescTable would return our table we want to display
descTable <- reactive({
# This would prevent it from being rendered if the submit button hasn't been pressed or there isn't data
req(input$submitButton)
req(input$file1)
deriveDescTable(filepath, otherParams)
})
output$descTab <- renderTable(descTab)
}
I'm also seeing the use of Sys.sleep in certain places. It looks like this might be to wait for some calculations to complete but this will also remove the need for that.
The text was updated successfully, but these errors were encountered:
More of a design question, this won't hold up a JOSS review. On of the major design tools in shiny is using reactive objects to avoid having complex server functions. Right now the server functions look like this:
While this is functioning fine, generally it is a good idea to separate the derivation of your objects from the server function and use the
req
function instead of something likeinput$button > 0
. So the functionality would become something like this:I'm also seeing the use of
Sys.sleep
in certain places. It looks like this might be to wait for some calculations to complete but this will also remove the need for that.The text was updated successfully, but these errors were encountered: