-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 10 snippet helper #28
Conversation
Started to test:
Maybe add a slot for nested modules as well as: # module R6Class ---------------------------------
#' R6 Class representing the module
#'
#' @description
#' UI and server code necessary for the module
#' @details
#' More details
#'
#' @export
module <- R6::R6Class(
"module",
inherit = tidymodules::TidyModule,
public = list(
#' @field nested_mod nested modules. This is updated by the initialize function.
nested_mod = list(),
#' @description
#' Module initialization
#' @param ... NULL by default.
#' @return A new `module` object.
initialize = function(...) {
super$initialize(...)
# initialize nested modules
# self$nested_mod[[1]] <- Nested$new(inherit = TRUE)
# define ports
self$definePort({
})
},
#' @description
#' Create the module UI
#' @return ...
ui = function() {
tagList(
# UI elements go here
)
},
#' @description
#' Server function description
#' @param input Shiny input object.
#' @param output Shiny output object.
#' @param session Shiny session object.
#' @return The server function.
server = function(input, output, session) {
super$server(input, output, session)
# call all nasted modules below
# self$nested_mod[[1]]$callModule()
# update output ports
self$assignPort({
# self$updateOutputPort(...)
})
}
)
) |
Second test fails:
|
Add @family tag to roxygen for linking {tm} modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few changes addressing most of your feedbacks, could you please re-check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! certainly will help newcomers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-l-1 Really nice additions to the package! These helpers are user-friendly and should definitely help reduce overhead when creating new classes. Looking forward to using them.
#10