Releases: esp/esp-js
Releases · esp/esp-js
0.8.3
0.8.2
0.8.1
0.8.0
Adding Observable.subscribeOn and Observable.observeOn. This enables better model to model interactions by allowing models to expose and consume observable streams which will run within a dispatch loop for the model/s in question.
For example a model could expose an esp observable stream such as:
getPrices() {
return esp.Observable.create(
observer => {
// on a dispatch loop for this.modelId
return this.priceSubject.observe(observer);
}
).subscribeOn(this._router, this.modelId);
}
When a consumer observes this stream the observation factory will be called on the dispatch loop for this.modelId
in question.
Similarly, a model consuming an observable stream can do this:
_testModel1
.getPrices()
.observeOn(_router, 'myModelId') // i.e. the model where this code resides
.where(p => p.pair === 'EURUSD')
.observe(
p => {
// on a dispatch loop for myModelId
// update model state here
},
() => {
// on a dispatch loop for myModelId
}
);
Check the tests for more usage examples.
0.7.12
0.7.11
0.7.10
0.7.9
0.7.8
0.7.7
Minor typescript definition update:
Adds DisposableBase
and CompositeDisposable
which exists in the JS