@polylith/core 0.0.8 → 0.0.9
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 +6 -6
- package/package.json +1 -1
package/Registry.js
CHANGED
|
@@ -26,7 +26,7 @@ class Registry {
|
|
|
26
26
|
return this.services[name];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
makeService(name, obj,
|
|
29
|
+
makeService(name, obj, methodsSpec) {
|
|
30
30
|
obj.serviceObject = new ServiceOject(name);
|
|
31
31
|
|
|
32
32
|
obj.serviceObject.implementOn(obj, 'fire');
|
|
@@ -37,10 +37,10 @@ class Registry {
|
|
|
37
37
|
registry.register(name, obj.serviceObject);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
if (
|
|
40
|
+
if (methodsSpec) {
|
|
41
41
|
var methods = {};
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
methodsSpec.forEach(function(name) {
|
|
44
44
|
if (obj[name]) {
|
|
45
45
|
methods[name] = obj[name].bind(obj);
|
|
46
46
|
} else {
|
|
@@ -52,7 +52,7 @@ class Registry {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
extendService(name, obj,
|
|
55
|
+
extendService(name, obj, methodsSpec) {
|
|
56
56
|
var serviceObject = this.subscribe(name);
|
|
57
57
|
|
|
58
58
|
obj.serviceObject = serviceObject || new ServiceOject(name);
|
|
@@ -61,10 +61,10 @@ class Registry {
|
|
|
61
61
|
obj.serviceObject.implementOn(obj, 'listen');
|
|
62
62
|
obj.serviceObject.implementOn(obj, 'unlisten');
|
|
63
63
|
|
|
64
|
-
if (
|
|
64
|
+
if (methodsSpec) {
|
|
65
65
|
var methods = {};
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
methodsSpec.forEach(function(name) {
|
|
68
68
|
if (obj[name]) {
|
|
69
69
|
methods[name] = obj[name].bind(obj);
|
|
70
70
|
} else {
|