The premise is that you have a Stream - a source of events spread over time.
You can connect to Stream and create a logical chain that will fire when a new event is emitted:
var button = document.querySelector('#button'); var clickStream = Rx.Observable.fromEvent(button, 'click'); clickStream .map(...) .subscribe(...)
You define a potential change in your system and connect a reaction chain to it.
What I am trying to fit within this relatively straightforward paradigm is initial data loading (or any other "untriggered" logical chain) - where you want to load some initial data "upfront", upon creation of the corresponding component, perhaps.
It seems to me that, at least in Rx, the paradigm is to have something similar to:
var source = Rx.Observable.just(somePerhapsAsyncDataSource); var subscription = source.subscribe(...);
So, as far as I can tell, it's an "immediately invoked observable" (within event loop constraints, naturally), which feels a bit forced.
Is this the commonly accepted paradigm for "untriggered"/initial loading of data or any other activity?
Other solutions involve abominations like synthetic observables (where you have a
shouldLoadData property on some EventEmitter or similar, with the load chain attached, and set it to
true when the component is created). Awful.