@polylith/core 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Registry.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ServiceOject } from "./ServiceObject";
2
- import { makeEventable} from "./Eventable";
1
+ import { ServiceOject } from "./ServiceObject.js";
2
+ import { makeEventable} from "./Eventable.js";
3
3
 
4
- class Registry {
4
+ export class Registry {
5
5
  constructor () {
6
6
  this.services = {};
7
7
 
package/Service.js CHANGED
@@ -2,15 +2,17 @@ import { ServiceOject } from "./ServiceObject.js";
2
2
  import { registry } from "./Registry.js";
3
3
 
4
4
  export class Service {
5
- constructor (name) {
5
+ constructor (name, overrideRegistry) {
6
6
  this.serviceObject = new ServiceOject(name);
7
7
 
8
+ this.registry = overrideRegistry || registry;
9
+
8
10
  this.serviceObject.implementOn(this, 'fire');
9
11
  this.serviceObject.implementOn(this, 'listen');
10
12
  this.serviceObject.implementOn(this, 'unlisten');
11
13
 
12
14
  if (name) {
13
- registry.register(name, this.serviceObject);
15
+ tregistry.register(name, this.serviceObject);
14
16
  }
15
17
  }
16
18
 
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { registry } from './Registry.js';
1
+ import { registry, Registry } from './Registry.js';
2
2
  import { makeEventable } from './Eventable.js';
3
3
  import { Service } from './Service.js';
4
4
 
5
- export {registry as registry, Service as Service, makeEventable as makeEventable}
5
+ export {registry, Registry, Service, makeEventable}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@polylith/core",
3
3
  "access": "public",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "description": "Core of the client-side polylith framework",
6
6
  "main": "index.js",
7
7
  "scripts": {