@knowlearning/agents 0.3.6 → 0.3.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -29,7 +29,7 @@ export default function MutableProxy(state, interact, ephemeralPaths={}, parentP
29
29
  .entries(state)
30
30
  .filter(([, value]) => value instanceof Object)
31
31
  .forEach(([key, value]) => {
32
- if (isArray && /^\d+$/.test(prop)) key = parseInt(key)
32
+ if (isArray && /^\d+$/.test(key)) key = parseInt(key)
33
33
  state[key] = childMutableProxy(key, value)
34
34
  })
35
35
 
@@ -8,11 +8,11 @@ function isScopeSerializable(v) {
8
8
  )
9
9
  }
10
10
 
11
- export default async function (module, props) {
11
+ export default async function (module, props, scope) {
12
12
  const component = module.default ? { ...module.default } : { ...module } // copy component since we will mess with mounted and data functions
13
13
 
14
14
  if (!component.ephemeral) {
15
- const state = await Agent.mutate()
15
+ const state = await Agent.mutate(scope)
16
16
 
17
17
  if (component.data) {
18
18
  const origDataFn = component.data