@@ -242,7 +242,7 @@ function JSON.lower(scope::Scope)
242
242
if sync === nothing
243
243
# by default, we sync if there are any listeners
244
244
# other than the JS back edge
245
- sync = any (f -> ! isa (f, SyncCallback), listeners (ob))
245
+ sync = any (((_, f),) -> ! isa (f, SyncCallback), listeners (ob))
246
246
end
247
247
obs_dict[k] = Dict (
248
248
" sync" => sync,
@@ -332,31 +332,21 @@ struct SyncCallback
332
332
end
333
333
334
334
(s:: SyncCallback )(xs... ) = s. f (xs... )
335
+
335
336
"""
336
337
Set observable without synchronizing with the counterpart on the browser.
337
338
338
339
This is mostly used to update observables in response to updates sent from th
339
340
browser (so that we aren't sending the same update *back* to the browser).
340
341
"""
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)
357
347
end
358
- return
359
348
end
349
+ return
360
350
end
361
351
362
352
const lifecycle_commands = [" scope_created" ]
388
378
function ensure_sync (ctx, key)
389
379
ob = ctx. observs[key][1 ]
390
380
# 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))
392
382
f = SyncCallback (ctx, (msg) -> send_update_observable (ctx, key, msg))
393
383
on (SyncCallback (ctx, f), ob)
394
384
end
0 commit comments