Skip to content

Commit 3947eb3

Browse files
committed
docs: updated for changes in on() function
- updated doc-string - change stop_if to stop_if_not (see changes to NAMESPACE as well) - add entry to roxygen which seems to be (?) necessary to make a link to a function in a different package via shiny::observeEvent
1 parent 92df041 commit 3947eb3

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ Suggests:
2020
rmarkdown,
2121
testthat (>= 3.0.0)
2222
VignetteBuilder: knitr
23+
Roxygen: list(markdown = TRUE)
2324
Config/testthat/edition: 3

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export(init)
66
export(on)
77
export(trigger)
88
export(watch)
9-
importFrom(attempt,stop_if)
9+
importFrom(attempt,stop_if_not)
1010
importFrom(shiny,getDefaultReactiveDomain)
1111
importFrom(shiny,observeEvent)
1212
importFrom(shiny,reactiveVal)

R/funs.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,19 @@ watch <- function(name, session = getDefaultReactiveDomain()){
110110

111111
#' React on an event
112112
#'
113-
#' @param name the name of the event to react to
114-
#' @param expr the expression to run when the event
115-
#' is triggered.
116-
#' @param session The shiny session object
117-
#'
118-
#' @return An observeEvent object. This object will
113+
#' @param name The name of the event to react to as a character; can be a
114+
#' character vector of event names in which case a reaction is triggered if
115+
#' any (all) of the events is (are) triggered (i.e. the non-exclusive "OR"
116+
#' case).
117+
#' @param expr The expression to run when the event is triggered.
118+
#' @param session The shiny session object.
119+
#'
120+
#' @return An [shiny::observeEvent()] object. This object will
119121
#' rarely be used, `on` is mainly called for side-effects.
120122
#'
121123
#' @export
122124
#' @importFrom shiny observeEvent getDefaultReactiveDomain
123-
#' @importFrom attempt stop_if
125+
#' @importFrom attempt stop_if_not
124126
on <- function(
125127
name,
126128
expr,

0 commit comments

Comments
 (0)