@ewnd9/registry

1.0.1 • Public • Published

registry

Build Status

Simple registry for interconnected objects

Install

$ npm install --save @ewnd9/registry

Usage

const Registry = require('@ewnd9/registry');
const registry = new Registry('services');

const A = registry.define('A', {
  sayHi() {
    console.log('hi from A');
  },
  run() {
    this.services.B.sayHi();
  }
});

const B = registry.define('B', {
  sayHi() {
    console.log('hi from B');
    this.services.A.sayHi();
  }
});

A.run();
// 'hi from B'
// 'hi from A'

Related

License

MIT © ewnd9

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @ewnd9/registry

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • ewnd9