0.1.0 • Published 11 years ago
rx-service-manager v0.1.0
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);
});
0.1.0
11 years ago