/javascript-ioc-library

iAdvize Inversion of Control container

Primary LanguageJavaScriptMIT LicenseMIT

javascript-ioc-library CircleCI

iAdvize Inversion of Control container.

Examples

registry.addCoreFeature('MyCoreFeature', [function() {

  // return public API
  return {
    method: function(){
      return Math.random() > 0.5;
    }
  };
}]);

registry.addCoreFeature('MyCoreFeature2', ['MyCoreFeature', function(MyCoreFeature2) {

  // return public API
  return {
    method: function(){
      return MyCoreFeature2.method();
    }
  };
}]);

Install

npm install iadvize-ioc-library -S

Documentation

Creating a registry

To declare a new registry do :

const registry = Registry();

Contribute

Look at contribution guidelines here : CONTRIBUTING.md