Skip to content

Commit

Permalink
add webassembly app prototyping files
Browse files Browse the repository at this point in the history
  • Loading branch information
rpodcast committed Mar 17, 2024
1 parent 9877542 commit 8a3527b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/R/fct_tables.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
record_analysis_table <- function(df) {
reactable::reactable(df)
}

record_detail_table <- function(df) {
reactable::reactable(df)
}
36 changes: 36 additions & 0 deletions app/R/mod_tbl.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#' tbl UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList
mod_tbl_ui <- function(id) {
ns <- NS(id)
tagList(
reactable::reactableOutput(ns("record_table"))
)
}

#' tbl Server Functions
#'
#' @noRd
#'
mod_tbl_server <- function(id, record_df) {
moduleServer(id, function(input, output, session) {
ns <- session$ns

output$record_table <- reactable::renderReactable({
req(record_df())
record_detail_table(record_df())
})
})
}

## To be copied in the UI
# mod_tbl_ui("tbl_1")

## To be copied in the server
# mod_tbl_server("tbl_1")

0 comments on commit 8a3527b

Please sign in to comment.