Reactive programming, Observables, timeless patterns and new implementations
-- The introduction to Reactive Programming you've been missing by Andre Staltz
...is a set of libraries to compose asynchronous and event-based programs using observable collections and Array#extras style composition in JavaScript
(to avoid "callback hell")
// on page init
const subscription = ApiService.getSomeData()
.subscribe(
function (x) {
console.log('Success: %s', x);
},
function (err) {
console.log('Error: %s', err);
},
function () {
console.log('Completed!');
}
)
// on page leave
subscription.unsubscribe()
Damir Šehić
damir @jsgzb
@DyslexicDcuk
DyslexicDcuk