@live-change/dao 0.3.15 → 0.4.1

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/lib/Observable.js CHANGED
@@ -22,7 +22,7 @@ class Observable {
22
22
  fireObservers(signal, ...args) {
23
23
  if(this.disposed) return
24
24
  let handled = false
25
- const observersToFire = this.observers
25
+ const observersToFire = this.observers.slice()
26
26
  for(const observer of observersToFire) {
27
27
  handled = this.fireObserver(observer, signal, ...args) || handled
28
28
  }
@@ -18,9 +18,9 @@ class ObservableList extends Observable {
18
18
  }
19
19
 
20
20
  set(list) {
21
- if(list === this.list) return;
21
+ if(list === this.list) return
22
22
  try {
23
- if (JSON.stringify(list) == JSON.stringify(this.list)) return;
23
+ if (JSON.stringify(list) == JSON.stringify(this.list)) return
24
24
  } catch(e) {}
25
25
  this.list = this.valueActivator ? this.valueActivator(list) : list
26
26
  this.fireObservers('set', list)
@@ -81,7 +81,7 @@ class ObservableProxy extends Observable {
81
81
  let beenDisposed = this.disposed
82
82
  Observable.prototype.observe.apply(this, args)
83
83
  if(!beenDisposed) {
84
- if(this.observable.getValue) {
84
+ if(this.observable && this.observable.getValue) {
85
85
  const value = this.observable.getValue()
86
86
  if(value !== undefined) this.fireObserver(args[0], 'set', value)
87
87
  } else {
package/package.json CHANGED
@@ -4,13 +4,13 @@
4
4
  "name": "Michał Łaszczewski",
5
5
  "url": "https://www.viamage.com/"
6
6
  },
7
- "homepage": "https://github.com/live-change/dao",
7
+ "homepage": "https://github.com/live-change/live-change-dao",
8
8
  "bugs": {
9
- "url": "https://github.com/live-change/dao/issues"
9
+ "url": "https://github.com/live-change/live-change-dao/issues"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/live-change/dao.git"
13
+ "url": "https://github.com/live-change/live-change-dao.git"
14
14
  },
15
15
  "dependencies": {
16
16
  "debug": "^4.1.1"
@@ -31,10 +31,10 @@
31
31
  }
32
32
  ],
33
33
  "name": "@live-change/dao",
34
- "optionalDependencies": {},
35
34
  "readme": "README.md",
36
35
  "scripts": {
37
36
  "test": "NODE_ENV=test blue-tape tests/*"
38
37
  },
39
- "version": "0.3.15"
38
+ "version": "0.4.1",
39
+ "gitHead": "ea2d38a0401c1405bb3ca011a43a50dc7ada6cf6"
40
40
  }