@indra.ai/deva 1.1.19 → 1.1.20
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/index.js +7 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -165,6 +165,13 @@ class Deva {
|
|
|
165
165
|
try {
|
|
166
166
|
// set the assigned listeners for the agent.
|
|
167
167
|
for (let listener in this.listeners) {
|
|
168
|
+
// set the default listeners for the states of the agent.
|
|
169
|
+
for (let state in this._states) {
|
|
170
|
+
this.events.on(`${this.agent.key}:${state}`, packet => {
|
|
171
|
+
return this[state](packet);
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
|
|
168
175
|
this.events.on(listener, packet => {
|
|
169
176
|
return this.listeners[listener](packet);
|
|
170
177
|
})
|
|
@@ -190,13 +197,6 @@ class Deva {
|
|
|
190
197
|
***************/
|
|
191
198
|
_assignInherit() {
|
|
192
199
|
return new Promise((resolve, reject) => {
|
|
193
|
-
// set the default listeners for the states of the agent.
|
|
194
|
-
for (let state in this._states) {
|
|
195
|
-
this.events.on(`${this.agent.key}:${state}`, packet => {
|
|
196
|
-
return this[state](packet);
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
|
|
200
200
|
try {
|
|
201
201
|
for (let d in this.devas) {
|
|
202
202
|
this.inherit.forEach(inherit => {
|