Skip to content

Commit 476647a

Browse files
committed
handle tuple inputs in add_callback!
1 parent 22ef643 commit 476647a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/metadata.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ See also [`set_callback!`](@ref).
588588
"""
589589
function add_callback!(c::ComponentModel, cb; check=true)
590590
check && assert_cb_compat(c, cb)
591-
newcb = has_callback(c) ? (get_callbacks(c)..., cb) : (cb, )
591+
cbs = cb isa ComponentCallback ? (cb,) : cb
592+
newcb = has_callback(c) ? (get_callbacks(c)..., cbs...) : cbs
592593
set_metadata!(c, :callback, newcb)
593594
end
594595
add_callback!(nw::Network, idx::VCIndex, cb; kw...) = add_callback!(getcomp(nw, idx), cb; kw...)

0 commit comments

Comments
 (0)