@polylith/core 0.1.1 → 0.1.3
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/Eventable.js +1 -1
- package/Registry.js +3 -3
- package/Service.js +6 -4
- package/index.js +4 -6
- package/package.json +3 -2
package/Eventable.js
CHANGED
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
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { ServiceOject } from "./ServiceObject";
|
|
2
|
-
import { registry } from "./Registry";
|
|
1
|
+
import { ServiceOject } from "./ServiceObject.js";
|
|
2
|
+
import { registry } from "./Registry.js";
|
|
3
3
|
|
|
4
4
|
export class Service {
|
|
5
5
|
constructor (name) {
|
|
6
|
-
this.serviceObject = new ServiceOject(name);
|
|
6
|
+
this.serviceObject = new ServiceOject(name, overrideRegistry);
|
|
7
|
+
|
|
8
|
+
this.registry = overrideRegistry || registry;
|
|
7
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
|
+
this.registry.register(name, this.serviceObject);
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
|
package/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { registry } from './Registry';
|
|
2
|
-
import { makeEventable } from './Eventable';
|
|
3
|
-
import { Service } from './Service';
|
|
4
|
-
import App from './App';
|
|
1
|
+
import { registry, Registry } from './Registry.js';
|
|
2
|
+
import { makeEventable } from './Eventable.js';
|
|
3
|
+
import { Service } from './Service.js';
|
|
5
4
|
|
|
6
|
-
export {registry
|
|
7
|
-
App as App};
|
|
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.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"description": "Core of the client-side polylith framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -11,5 +11,6 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"uuid": "^8.3.2"
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
"type": "module"
|
|
15
16
|
}
|