@polylith/core 0.1.13 → 0.1.14
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 +7 -7
- package/Service.js +2 -2
- package/ServiceObject.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/Registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServiceObject } from "./ServiceObject.js";
|
|
2
2
|
import { makeEventable} from "./Eventable.js";
|
|
3
3
|
import Defer from "./Defer.js";
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ export class Registry {
|
|
|
22
22
|
* @returns the newly created sercice object
|
|
23
23
|
*/
|
|
24
24
|
createServiceObject(name) {
|
|
25
|
-
var result = new
|
|
25
|
+
var result = new ServiceObject(name);
|
|
26
26
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
@@ -32,7 +32,7 @@ export class Registry {
|
|
|
32
32
|
* be subscribed to fromn the registry by the given name.
|
|
33
33
|
*
|
|
34
34
|
* @param {String} name the namke of the object being registered.
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {ServiceObject} serviceObject the service object being registered.
|
|
36
36
|
*/
|
|
37
37
|
register(name, serviceObject) {
|
|
38
38
|
this.services[name] = serviceObject;
|
|
@@ -52,7 +52,7 @@ export class Registry {
|
|
|
52
52
|
* Call this method to get a reference to the service object.
|
|
53
53
|
*
|
|
54
54
|
* @param {String} name the registered name of the service object
|
|
55
|
-
* @returns {
|
|
55
|
+
* @returns {ServiceObject} the registered service object, ot false if it was
|
|
56
56
|
* not found.
|
|
57
57
|
*/
|
|
58
58
|
subscribe(name) {
|
|
@@ -72,7 +72,7 @@ export class Registry {
|
|
|
72
72
|
* be bound to the passed implementation object.
|
|
73
73
|
*/
|
|
74
74
|
makeService(serviceName, obj, methodList) {
|
|
75
|
-
obj.serviceObject = new
|
|
75
|
+
obj.serviceObject = new ServiceObject(serviceName);
|
|
76
76
|
|
|
77
77
|
obj.serviceObject.implementOn(obj, 'fire');
|
|
78
78
|
obj.serviceObject.implementOn(obj, 'listen');
|
|
@@ -111,7 +111,7 @@ export class Registry {
|
|
|
111
111
|
extendService(serviceName, obj, methodList) {
|
|
112
112
|
var serviceObject = this.subscribe(serviceName);
|
|
113
113
|
|
|
114
|
-
obj.serviceObject = serviceObject || new
|
|
114
|
+
obj.serviceObject = serviceObject || new ServiceObject(serviceName);
|
|
115
115
|
|
|
116
116
|
obj.serviceObject.implementOn(obj, 'fire');
|
|
117
117
|
obj.serviceObject.implementOn(obj, 'listen');
|
|
@@ -177,7 +177,7 @@ export class Registry {
|
|
|
177
177
|
/**
|
|
178
178
|
* Call this method handle the service start deferreds
|
|
179
179
|
*
|
|
180
|
-
* @param {
|
|
180
|
+
* @param {ServiceObject} serviceObject the service object to add the method
|
|
181
181
|
* to
|
|
182
182
|
* @param {*} result the result of the start method
|
|
183
183
|
*/
|
package/Service.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServiceObject } from "./ServiceObject.js";
|
|
2
2
|
import { registry } from "./Registry.js";
|
|
3
3
|
|
|
4
4
|
export class Service {
|
|
5
5
|
constructor (name, overrideRegistry) {
|
|
6
|
-
this.serviceObject = new
|
|
6
|
+
this.serviceObject = new ServiceObject(name);
|
|
7
7
|
|
|
8
8
|
this.registry = overrideRegistry || registry;
|
|
9
9
|
|
package/ServiceObject.js
CHANGED
|
@@ -5,7 +5,7 @@ import { EventBus } from './EventBus.js';
|
|
|
5
5
|
* Service implementations will extend this object by adding methods and events.
|
|
6
6
|
* Service objects are eventable objects, and inherit from the EventBus object
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class ServiceObject extends EventBus {
|
|
9
9
|
/**
|
|
10
10
|
* Constructor for the service object
|
|
11
11
|
* @param {String} name the name of the service being registered.
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registry, Registry } from './Registry.js';
|
|
2
2
|
import { makeEventable } from './Eventable.js';
|
|
3
3
|
import { Service } from './Service.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ServiceObject } from './ServiceObject.js';
|
|
5
5
|
import { EventBus } from './EventBus.js';
|
|
6
6
|
|
|
7
|
-
export {registry, Registry, Service, makeEventable, EventBus,
|
|
7
|
+
export {registry, Registry, Service, makeEventable, EventBus, ServiceObject}
|