@@ -208,7 +208,6 @@ Dash <- R6::R6Class(
208
208
209
209
dash_update <- paste0(self $ config $ routes_pathname_prefix , " _dash-update-component" )
210
210
route $ add_handler(" post" , dash_update , function (request , response , keys , ... ) {
211
-
212
211
request <- request_parse_json(request )
213
212
214
213
if (! " output" %in% names(request $ body )) {
@@ -255,6 +254,9 @@ Dash <- R6::R6Class(
255
254
}
256
255
}
257
256
257
+ # set the callback context associated with this invocation of the callback
258
+ private $ callback_context_ <- setCallbackContext(request $ body )
259
+
258
260
output_value <- getStackTrace(do.call(callback , callback_args ),
259
261
debug = private $ debug ,
260
262
pruned_errors = private $ pruned_errors )
@@ -463,8 +465,22 @@ Dash <- R6::R6Class(
463
465
state = state ,
464
466
func = func
465
467
)
468
+
469
+ # # register the callback_context elements
470
+ # private$callback_context_[[paste(output$id, output$property, sep='.')]] <- list(
471
+ # states=setCallbackContext(state),
472
+ # triggered=list(),
473
+ # inputs=getContextElements(inputs)
474
+ # )
466
475
},
467
476
477
+ # ------------------------------------------------------------------------
478
+ # request and return callback context
479
+ # ------------------------------------------------------------------------
480
+ callback_context = function () {
481
+ private $ callback_context_
482
+ },
483
+
468
484
# ------------------------------------------------------------------------
469
485
# convenient fiery wrappers
470
486
# ------------------------------------------------------------------------
@@ -517,7 +533,10 @@ Dash <- R6::R6Class(
517
533
# initialize flags for debug mode and stack pruning,
518
534
debug = NULL ,
519
535
pruned_errors = NULL ,
520
-
536
+
537
+ # callback context
538
+ callback_context_ = NULL ,
539
+
521
540
# fields for tracking HTML dependencies
522
541
dependencies = list (),
523
542
dependencies_user = list (),
0 commit comments