vigetlabs / microcosm

Flux with actions at center stage. Write optimistic updates, cancel requests, and track changes with ease.
http://code.viget.com/microcosm/
MIT License
487 stars 22 forks source link

[microcosm] Async, scheduled, subjects #513

Closed nhunzaker closed 6 years ago

nhunzaker commented 6 years ago

This commit brings the asychronous behavior of Observables over to Subjects. It is also able to consolidate some behavior by extending Observable.

The async behavior of Subjects is different in that they track a present value. When subscribed to, Subjects immediately emit an update. All future work is scheduled.

This is a really nice system because it allows Presenter view models to immediately have a value, and for state to be synchronized by the time Effects dispatch.