Skip to content

Commit b23c248

Browse files
author
Ryan Patrick Kyle
committed
✏️ 📚 no_update -> dashNoUpdate, docs
1 parent bfe9cbb commit b23c248

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
S3method(print,dash_component)
44
export(Dash)
5+
export(dashNoUpdate)
56
export(input)
67
export(output)
78
export(state)

R/dash.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,6 @@ Dash <- R6::R6Class(
524524
private$callback_context_
525525
},
526526

527-
# ------------------------------------------------------------------------
528-
# no_update may be used within a callback to prevent a single output
529-
# from updating; it returns a wrapped NULL of class "no_update"
530-
# ------------------------------------------------------------------------
531-
no_update = function() {
532-
x <- list(NULL)
533-
class(x) <- "no_update"
534-
return(x)
535-
},
536-
537527
# ------------------------------------------------------------------------
538528
# convenient fiery wrappers
539529
# ------------------------------------------------------------------------

R/dependencies.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
#' Use in conjunction with the `callback()` method from the [dash::Dash] class
66
#' to define the update logic in your application.
77
#'
8+
#' The `dashNoUpdate()` function permits application developers to prevent a
9+
#' single output from updating the layout. It has no formal arguments, but
10+
#' returns an object of class `no_update`, for which Dash will return a `204`
11+
#' status code and empty response body.
12+
#'
813
#' @name dependencies
914
#' @param id a component id
1015
#' @param property the component property to use
1116

12-
1317
#' @rdname dependencies
1418
#' @export
1519
output <- function(id, property) {
@@ -44,3 +48,11 @@ dependency <- function(id = NULL, property = NULL) {
4448
property = property
4549
)
4650
}
51+
52+
#' @rdname dependencies
53+
#' @export
54+
dashNoUpdate <- function() {
55+
x <- list(NULL)
56+
class(x) <- "no_update"
57+
return(x)
58+
}

man/dependencies.Rd

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)