@knowlearning/agents 0.3.4 → 0.3.6
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/agents/generic.js +6 -0
- package/package.json +1 -1
- package/persistence/json.js +4 -1
package/agents/generic.js
CHANGED
|
@@ -180,6 +180,12 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
180
180
|
const { ii, state } = await lastMessageResponse()
|
|
181
181
|
sessionData[session].subscriptions[k] = ii
|
|
182
182
|
resolve(state)
|
|
183
|
+
if (ii === -1) {
|
|
184
|
+
// -1 indicates the result is a computed scope, so
|
|
185
|
+
// ii does not apply (we clear out the subscription to not cache value)
|
|
186
|
+
delete states[k]
|
|
187
|
+
delete sessionData[session].subscriptions[k]
|
|
188
|
+
}
|
|
183
189
|
})
|
|
184
190
|
}
|
|
185
191
|
|
package/package.json
CHANGED
package/persistence/json.js
CHANGED
|
@@ -28,7 +28,10 @@ export default function MutableProxy(state, interact, ephemeralPaths={}, parentP
|
|
|
28
28
|
Object
|
|
29
29
|
.entries(state)
|
|
30
30
|
.filter(([, value]) => value instanceof Object)
|
|
31
|
-
.forEach(([key, value]) =>
|
|
31
|
+
.forEach(([key, value]) => {
|
|
32
|
+
if (isArray && /^\d+$/.test(prop)) key = parseInt(key)
|
|
33
|
+
state[key] = childMutableProxy(key, value)
|
|
34
|
+
})
|
|
32
35
|
|
|
33
36
|
const traps = {
|
|
34
37
|
set(target, prop, value) {
|