@knowlearning/agents 0.9.40 → 0.9.41

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.9.40",
3
+ "version": "0.9.41",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -25,8 +25,11 @@
25
25
  }
26
26
  },
27
27
  created() { this.startWatching() },
28
- unmounted() {
29
- if (this.stopWatching) this.stopWatching()
28
+ beforeUnmount() {
29
+ if (this.stopWatching) {
30
+ this.stopWatchingAttempted = true
31
+ this.stopWatching()
32
+ }
30
33
  },
31
34
  methods: {
32
35
  async startWatching() {
@@ -35,7 +38,10 @@
35
38
  const metadata = await Agent.metadata(this.id)
36
39
  this.value = this.path.length === 1 ? metadata[this.path[0]] : metadata
37
40
  }
38
- else this.stopWatching = Agent.watch([this.id, ...this.path], value => this.value = value)
41
+ else this.stopWatching = Agent.watch([this.id, ...this.path], value => {
42
+ if (this.stopWatchingAttempted) console.warn('Watcher not stopped for vueScopeComponent')
43
+ else this.value = value
44
+ })
39
45
  }
40
46
  }
41
47
  }