@knowlearning/agents 0.2.5 → 0.2.7

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.
@@ -66,6 +66,7 @@ export default function EmbeddedAgent() {
66
66
  promise.watch = fn => {
67
67
  key
68
68
  .then( async k => {
69
+ if (watchFn) throw new Error('Only one watcher allowed')
69
70
  if (!watchers[k]) watchers[k] = []
70
71
  watchers[k].push(fn)
71
72
  watchFn = fn
package/agents/generic.js CHANGED
@@ -196,7 +196,8 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
196
196
  promise.watch = fn => {
197
197
  key
198
198
  .then( k => {
199
- if (watchFn) throw new Error('Only one watcher allowed') // TODO: consider allowing more watchers per state call
199
+ if (watchFn) throw new Error('Only one watcher allowed')
200
+ if (!watchers[k]) watchers[k] = []
200
201
  watchers[k].push(fn)
201
202
  watchFn = fn
202
203
  })
package/browser.js ADDED
@@ -0,0 +1,6 @@
1
+ // TODO: export browser, node, deno, and generic agents
2
+ export { default as BrowserAgent } from './agents/browser/root.js'
3
+ export { default as GenericAgent } from './agents/generic.js'
4
+ export { default as vuePersistentStore } from './persistence/vuex.js'
5
+ export { default as vueContentComponent } from './vue/3/content.vue'
6
+ export { default as vuePersistentComponent } from './vue/3/component.js'
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
- "main": "package/node.js",
6
- "browser": "package/browser.js",
5
+ "main": "node.js",
6
+ "browser": "browser.js",
7
7
  "type": "module",
8
8
  "directories": {
9
9
  "example": "examples",
@@ -1,6 +0,0 @@
1
- // TODO: export browser, node, deno, and generic agents
2
- export { default as BrowserAgent } from '../agents/browser/root.js'
3
- export { default as GenericAgent } from '../agents/generic.js'
4
- export { default as vuePersistentStore } from '../persistence/vuex.js'
5
- export { default as vueContentComponent } from '../vue/3/content.vue'
6
- export { default as vuePersistentComponent } from '../vue/3/component.js'
File without changes
File without changes