Singleton Module Registry
Implementation of the Registry Pattern to have loosely-coupled modules in your app. You can either use the singleton provided to just import the library or create as many Registry as you want and pass them to your different modules.
Breaking change notes
- We don't provide event emitter anymore because event emission is meant to decouple modules. But we use dependency injdection for this purpose so event emission is not needed anymore.
- We do not support module interdependency anymore (via the required property) because modules are meant to be decoupled units.
npm i --save singleton-module-registry
Using the singleton
; const registry = ; const moduleA moduleB = registry;
Instantiating a new registry
; const registry1 = ; registry1;const moduleA = registry; console; // prints 3