Skip to content

Commit

Permalink
Fix updating observables from browser with Observables.jl >= 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
twavv committed Sep 13, 2021
1 parent 08aeec3 commit c818b1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ end

(s::SyncCallback)(xs...) = s.f(xs...)
"""
Set observable without synchronizing with the counterpart on the browser
Set observable without synchronizing with the counterpart on the browser.
This is mostly used to update observables in response to updates sent from th
browser (so that we aren't sending the same update *back* to the browser).
"""
function set_nosync end

Expand All @@ -346,6 +349,7 @@ if isdefined(Observables, :setexcludinghandlers)
else
# Observables >=0.4
function set_nosync(ob, val)
Observables.setexcludinghandlers!(ob, val)
for f in listeners(ob)
if !(f isa SyncCallback)
Base.invokelatest(f, val)
Expand Down

0 comments on commit c818b1f

Please sign in to comment.