Review notes: It's probably best to view this in split-view
What is it
This commit updates the Observable abstraction in Microcosm such that it is asynchronous.
Updates to observables are queued with a universal scheduler. Until this scheduler "flushes" an observable, updates are buffered within an internal list of updates.
Why
The scheduler dispatches updates as fast as the browser will allow it to, using requestIdleCallback. When requestIdleCallback is not provided, it uses setTimeout.
This means that Microcosm's scheduler does not block the browser. Work might be slow, but the browser never suffers.
Review notes: It's probably best to view this in split-view
What is it
This commit updates the Observable abstraction in Microcosm such that it is asynchronous.
Updates to observables are queued with a universal scheduler. Until this scheduler "flushes" an observable, updates are buffered within an internal list of updates.
Why
The scheduler dispatches updates as fast as the browser will allow it to, using requestIdleCallback. When requestIdleCallback is not provided, it uses setTimeout.
This means that Microcosm's scheduler does not block the browser. Work might be slow, but the browser never suffers.