@@ -242,7 +242,7 @@ function JSON.lower(scope::Scope)
242242 if sync === nothing
243243 # by default, we sync if there are any listeners
244244 # other than the JS back edge
245- sync = any (f -> ! isa (f, SyncCallback), listeners (ob))
245+ sync = any (((_, f),) -> ! isa (f, SyncCallback), listeners (ob))
246246 end
247247 obs_dict[k] = Dict (
248248 " sync" => sync,
@@ -332,31 +332,21 @@ struct SyncCallback
332332end
333333
334334(s:: SyncCallback )(xs... ) = s. f (xs... )
335+
335336"""
336337Set observable without synchronizing with the counterpart on the browser.
337338
338339This is mostly used to update observables in response to updates sent from th
339340browser (so that we aren't sending the same update *back* to the browser).
340341"""
341- function set_nosync end
342-
343- if isdefined (Observables, :setexcludinghandlers )
344- # Observables <=0.3
345- function set_nosync (ob, val)
346- Observables. setexcludinghandlers (ob, val, x -> ! (x isa SyncCallback))
347- return
348- end
349- else
350- # Observables >=0.4
351- function set_nosync (ob, val)
352- Observables. setexcludinghandlers! (ob, val)
353- for f in listeners (ob)
354- if ! (f isa SyncCallback)
355- Base. invokelatest (f, val)
356- end
342+ function set_nosync (ob, val)
343+ Observables. setexcludinghandlers! (ob, val)
344+ for (_, f) in listeners (ob)
345+ if ! (f isa SyncCallback)
346+ Base. invokelatest (f, val)
357347 end
358- return
359348 end
349+ return
360350end
361351
362352const lifecycle_commands = [" scope_created" ]
388378function ensure_sync (ctx, key)
389379 ob = ctx. observs[key][1 ]
390380 # have at most one synchronizing handler per observable
391- if ! any (x -> isa (x, SyncCallback) && x. ctx== ctx, listeners (ob))
381+ if ! any (((_, x),) -> isa (x, SyncCallback) && x. ctx== ctx, listeners (ob))
392382 f = SyncCallback (ctx, (msg) -> send_update_observable (ctx, key, msg))
393383 on (SyncCallback (ctx, f), ob)
394384 end
0 commit comments