Skip to content
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

Minor typo fixes - II #498

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
12 changes: 6 additions & 6 deletions scaling-functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ This doesn't make testing or debugging any easier, but it does reduce duplicated
We could of course add `session` to the arguments of the function:

```{r}
switch_page <- function(i) {
updateTabsetPanel(input = "wizard", selected = paste0("page_", i))
switch_page <- function(i, session) {
updateTabsetPanel(session = session, input = "wizard", selected = paste0("page_", i))
}

server <- function(input, output, session) {
observeEvent(input$page_12, switch_page(2))
observeEvent(input$page_21, switch_page(1))
observeEvent(input$page_23, switch_page(3))
observeEvent(input$page_32, switch_page(2))
observeEvent(input$page_12, switch_page(2, session))
observeEvent(input$page_21, switch_page(1, session))
observeEvent(input$page_23, switch_page(3, session))
observeEvent(input$page_32, switch_page(2, session))
}
```

Expand Down
2 changes: 1 addition & 1 deletion scaling-modules.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ This is a principled limitation of the module system which we'll discuss in more

Now let's use the wizard in a slightly more realistic app that has inputs and outputs, and yields Figure \@ref(fig:wizard-module).
The main point to notice is that even though the pages are displayed by the module, their ids are controlled by the user of the module.
It's the developer who creators the control who controls its name; it doesn't matter who ends up assembling the control for final display on the webpage.
It's the developer who creates the control and controls its name; it doesn't matter who ends up assembling the control for final display on the webpage.

```{r}
page1 <- tagList(
Expand Down
2 changes: 1 addition & 1 deletion scaling-testing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ summaryServer <- function(id, var) {
```

We'll use `testServer()` as above, but the call is a little different.
As before the first argument is the server function (now the the module server), but now we also need to supply additional arguments in a list called `args`.
As before the first argument is the server function (now the module server), but now we also need to supply additional arguments in a list called `args`.
This takes a list of arguments to the module server (the `id` argument is optional; `testServer()` will fill it in automatically if omitted).
Then we finish up with the code to run:

Expand Down