@@ -437,13 +437,15 @@ def create(
437437 value : EventType ,
438438 args_spec : ArgsSpec | Sequence [ArgsSpec ],
439439 key : Optional [str ] = None ,
440+ ** event_chain_kwargs ,
440441 ) -> Union [EventChain , Var ]:
441442 """Create an event chain from a variety of input types.
442443
443444 Args:
444445 value: The value to create the event chain from.
445446 args_spec: The args_spec of the event trigger being bound.
446447 key: The key of the event trigger being bound.
448+ **event_chain_kwargs: Additional kwargs to pass to the EventChain constructor.
447449
448450 Returns:
449451 The event chain.
@@ -462,6 +464,7 @@ def create(
462464 value = value .guess_type (),
463465 args_spec = args_spec ,
464466 key = key ,
467+ ** event_chain_kwargs ,
465468 )
466469 else :
467470 raise ValueError (
@@ -501,7 +504,9 @@ def create(
501504 result = call_event_fn (value , args_spec , key = key )
502505 if isinstance (result , Var ):
503506 # Recursively call this function if the lambda returned an EventChain Var.
504- return cls .create (value = result , args_spec = args_spec , key = key )
507+ return cls .create (
508+ value = result , args_spec = args_spec , key = key , ** event_chain_kwargs
509+ )
505510 events = [* result ]
506511
507512 # Otherwise, raise an error.
@@ -518,7 +523,7 @@ def create(
518523 return cls (
519524 events = events ,
520525 args_spec = args_spec ,
521- event_actions = {} ,
526+ ** event_chain_kwargs ,
522527 )
523528
524529
0 commit comments