@knowlearning/agents 0.5.12 → 0.5.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/agents/generic.js +1 -1
- package/package.json +1 -1
- package/persistence/vuex.js +1 -3
package/agents/generic.js
CHANGED
|
@@ -178,7 +178,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
178
178
|
|
|
179
179
|
if (states[message.scope].active === undefined) states[message.scope].active = {}
|
|
180
180
|
applyPatch(states[message.scope], standardJSONPatch(message.patch.slice(lastResetPatchIndex + 1)))
|
|
181
|
-
watchers[message.scope].forEach(fn => fn({ ...message, state: states[message.scope] }))
|
|
181
|
+
watchers[message.scope].forEach(fn => fn({ ...message, state: states[message.scope].active }))
|
|
182
182
|
if (sub) sub.ii = message.ii
|
|
183
183
|
}
|
|
184
184
|
}
|
package/package.json
CHANGED
package/persistence/vuex.js
CHANGED
|
@@ -11,7 +11,6 @@ async function scopeIsUninitialized(scope) {
|
|
|
11
11
|
|
|
12
12
|
export default async function (storeDefinition, scope=window.location.host) {
|
|
13
13
|
let state = copy(await Agent.state(scope))
|
|
14
|
-
|
|
15
14
|
const scopedPaths = getScopedPaths(storeDefinition)
|
|
16
15
|
const stateAttachedStore = await attachModuleState(state, storeDefinition, scopedPaths)
|
|
17
16
|
const s = stateAttachedStore.state
|
|
@@ -77,8 +76,7 @@ async function attachModuleState(state, module, scopedPaths, path='') {
|
|
|
77
76
|
}
|
|
78
77
|
return { ...module, state: () => state }
|
|
79
78
|
}
|
|
80
|
-
else return module
|
|
81
|
-
|
|
79
|
+
else return state ? { ...module, state: () => state } : module
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
function getScopedPaths(module, path="", paths={}) {
|