diff --git a/src/operators.jl b/src/operators.jl index 6d52a53..e344b82 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -297,7 +297,7 @@ function unbind!(a::Signal, b::Signal, twoway=true) end action = _bindings[a=>b] - a.actions = filter(x->x!=action, a.actions) + b.actions = filter(x->x!=action, b.actions) delete!(_bindings, a=>b) if twoway diff --git a/test/basics.jl b/test/basics.jl index d6952ca..ac90457 100644 --- a/test/basics.jl +++ b/test/basics.jl @@ -229,4 +229,22 @@ facts("Basic checks") do step() @fact value(y) --> 1 end + + + context("bindind") do + x = Signal(0) + y = Signal(0) + bind!(y,x,false) + + push!(x,1000) + step() + + @fact value(y) --> 1000 + + unbind!(y,x,false) + push!(x,0) + step() + + @fact value(y) --> 1000 + end end