Skip to content

Commit 68427b3

Browse files
committed
Updating checks
1 parent e934ca0 commit 68427b3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

R/utils.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ assert_valid_callbacks <- function(output, params, func) {
365365
!any(c('input', 'state') %in% attr(x, "class"))
366366
}, FUN.VALUE=logical(1))
367367

368+
invalid_outputs <- vapply(output, function(x) {
369+
!any(c('output', 'state') %in% attr(x, "class"))
370+
}, FUN.VALUE=logical(1))
371+
368372
# Verify that no outputs are duplicated
369373
if (length(output) != length(unique(output))) {
370374
stop(sprintf("One or more callback outputs have been duplicated; please confirm that all outputs are unique."), call. = FALSE)
@@ -375,11 +379,12 @@ assert_valid_callbacks <- function(output, params, func) {
375379
stop(sprintf("Callback parameters must be inputs or states. Please verify formatting of callback parameters."), call. = FALSE)
376380
}
377381

378-
# Verify that 'input' parameters always precede 'state', if present
379-
if (!(valid_seq(params))) {
380-
stop(sprintf("Strict ordering of callback handler parameters is required. Please ensure that input parameters precede all state parameters."), call. = FALSE)
382+
# Verify that output contains no elements that are not either members of 'output' or 'state' classes
383+
if (any(invalid_outputs)) {
384+
stop(sprintf("Callback outputs must be outputs or states. Please verify formatting of callback outputs."), call. = FALSE)
381385
}
382386

387+
383388
# Assert that the component ID as passed is a string.
384389
# This function inspects the output object to see if its ID
385390
# is a valid string.

0 commit comments

Comments
 (0)