rx-service-manager
v0.1.0
Published
An Rx based service manager
Downloads
37
Readme
Rx Service Manager
An Rx based service manager usable as an IoC container to acheive dependency injection.
Example
var Rx = require("rx");
var rxServiceManager = require("rx-service-manager");
var container = rxServiceManager({
"config": function(container) {
return Rx.Observable.fromArray([{ "title": "Super Website" }]);
},
"template": function(container) {
return container("config").flatMap(function(config) {
return Rx.Observable.fromArray(["Welcome to the " + config.title]);
});
}
});
container("template").subscribe(function(template) {
console.log(template);
});