Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,25 @@ Copy and paste these snippets to Tools > Global Options > Code > Editing > Edit

```{}
snippet module
${1:name}ui <- function(id){
mod_${1:name}_ui <- function(id) {
ns <- NS(id)
tagList(

)
}
${0}
)
}

${1:name} <- function(input, output, session){
mod_${1:name}_server <- function(id) {
moduleServer(id, function(input, output, session) {
ns <- session\$ns

})
}

# Copy in UI
${1:name}ui("${1:name}ui")
#mod_${1:name}_ui("${1:name}_ui")

# Copy in server
callModule(${1:name}, "${1:name}ui")
#mod_${1:name}_server("${1:name}_ui")
```

![](man/figures/module_snippet.gif)
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,25 @@ Editing \> Edit Snippets.
### Modules

snippet module
${1:name}ui <- function(id){
mod_${1:name}_ui <- function(id) {
ns <- NS(id)
tagList(

)
}

${1:name} <- function(input, output, session){
${0}
)
}

mod_${1:name}_server <- function(id) {
moduleServer(id, function(input, output, session) {
ns <- session\$ns

})
}

# Copy in UI
${1:name}ui("${1:name}ui")
#mod_${1:name}_ui("${1:name}_ui")

# Copy in server
callModule(${1:name}, "${1:name}ui")
#mod_${1:name}_server("${1:name}_ui")

![](man/figures/module_snippet.gif)

Expand All @@ -71,7 +74,7 @@ Editing \> Edit Snippets.

![](man/figures/observeEvent_snippet.gif)

### sidebar\_page
### sidebar_page

snippet sidebar_page
library(shiny)
Expand Down
17 changes: 10 additions & 7 deletions inst/snippets.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
snippet module
${1:name}ui <- function(id){
mod_${1:name}_ui <- function(id) {
ns <- NS(id)
tagList(
${0}
)
}
${0}
)
}

${1:name} <- function(input, output, session){
mod_${1:name}_server <- function(id) {
moduleServer(id, function(input, output, session) {
ns <- session\$ns

})
}

# Copy in UI
#${1:name}ui("${1:name}ui")
#mod_${1:name}_ui("${1:name}_ui")

# Copy in server
#callModule(${1:name}, "${1:name}ui")
#mod_${1:name}_server("${1:name}_ui")

snippet observe_event
observeEvent( ${1:event} , {
Expand Down
Binary file modified man/figures/module_snippet.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.