rxjs-autorun
rxjs-autorun copied to clipboard
Cover multiple sync emissions
Currently, we are skipping multiple sync emissions. This will wait for all 3 values from a
and only then would produce a result:
const a = of(1, 2, 3);
const b = of('🐁');
computed(() => $(a) + $(b)).subscribe(…); // > 3🐁
I think its fine for computed
, but it seems to be an issue for our shiny new combined
(or whatever name we end up with in #32):
combined(() => $(a) + $(b)).subscribe(…); // > 1🐁 > 2🐁 > 3🐁
Though it's not very clear how to handle this with multiple streams emitting synchronously.
combineLatest
ignores sync values from the first stream:
const a$ = of(1,2,3);
const b$ = of('a', 'b', 'c');
const result$ = combineLatest(a$, b$);
So, I'm not sure if, what, and how it should be done. Please, share your thoughts!