Observable streams registry
npm install observable-connectionIt is a registry for observable strams. Features:
- it manages dependent observables
- pretend to be small
- dictate app architechture (hornestly, already does)
- dictate DOM framework to use (initially developed with Angular 1.x, React is welcome too)
Real-time or polling web apps or applications with many different events to handle.
``javascript`
class MyConnection extends Connection;
const connection = new MyConnection(options);
`javascript
const Rx = require('rxjs');
const plugin = function userSelection() {
return new Rx.BehaviorSubject([]);
}
const connection = new MyConnection({
plugins: {plugin}
});
`
`javascript`
connection.userSelection.subscribe(selection => {
console.log('your selection: ', selection);
})
`javascript
const Rx = require('rxjs');
const plugin = function userSelection() {
const _secretValue = []; // immutable, if you want
const subject = new Rx.BehaviorSubject(_secretValue);
subject.add = (item) => {
// type check if you want
_secretValue.push(item);
subject.next(_secretValue);
}
return subject;
}
// ...
connection.userSelection.add('foo');
``