@knowlearning/agents 0.2.2 → 0.2.4

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.
@@ -21,8 +21,9 @@ export default () => {
21
21
  reboot: () => window.location.reload()
22
22
  })
23
23
 
24
- const { state } = agent
24
+ const { state, mutate } = agent
25
25
  agent.state = (scope=host,user,domain) => state(scope, user, domain)
26
+ agent.mutate = (scope=host) => mutate(scope)
26
27
 
27
28
  return agent
28
29
  }
package/agents/generic.js CHANGED
@@ -283,7 +283,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
283
283
  }
284
284
 
285
285
  async function mutate(scope, initialize=true) {
286
- const initial = initialize ? await this.state(scope) || {} : {}
286
+ const initial = initialize ? await state(scope) || {} : {}
287
287
  return new MutableProxy(initial, patch => interact(scope, patch))
288
288
  }
289
289
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "package/node.js",
6
6
  "browser": "package/browser.js",