rx-service-manager

0.1.0 • Public • Published

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);
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i rx-service-manager

Weekly Downloads

6

Version

0.1.0

License

none

Last publish

Collaborators

  • josephmoniz