@live-change/db 0.5.8 → 0.5.11
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/Index.js +12 -8
- package/package.json +5 -5
package/lib/Index.js
CHANGED
|
@@ -403,16 +403,20 @@ class IndexWriter {
|
|
|
403
403
|
this.index.update(id, ops)
|
|
404
404
|
}
|
|
405
405
|
change(obj, oldObj) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
try {
|
|
407
|
+
if (obj) {
|
|
408
|
+
if (oldObj && oldObj.id != obj.id) {
|
|
409
|
+
this.index.delete(oldObj.id)
|
|
410
|
+
this.index.put(obj)
|
|
411
|
+
} else {
|
|
412
|
+
this.index.put(obj)
|
|
413
|
+
}
|
|
411
414
|
} else {
|
|
412
|
-
this.index.
|
|
415
|
+
if (oldObj) this.index.delete(oldObj.id)
|
|
413
416
|
}
|
|
414
|
-
}
|
|
415
|
-
|
|
417
|
+
} catch(error) {
|
|
418
|
+
console.error("ERROR", error, "ON CHANGE", oldObj, "=>", obj)
|
|
419
|
+
throw error
|
|
416
420
|
}
|
|
417
421
|
}
|
|
418
422
|
get(id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-db",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@live-change/db-store-level": "^0.5.
|
|
25
|
-
"@live-change/db-store-lmdb": "^0.5.
|
|
24
|
+
"@live-change/db-store-level": "^0.5.11",
|
|
25
|
+
"@live-change/db-store-lmdb": "^0.5.11",
|
|
26
26
|
"minimist": ">=1.2.3",
|
|
27
27
|
"rimraf": "^3.0.2",
|
|
28
28
|
"sockjs": "^0.3.24",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"websocket-extensions": ">=0.1.4"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@live-change/dao": "0.4.
|
|
33
|
+
"@live-change/dao": "0.4.10",
|
|
34
34
|
"get-random-values": "^1.2.2",
|
|
35
35
|
"node-interval-tree": "^1.3.3"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "459aba0a8b3096f664d4820df8cac99a7ea0d26e"
|
|
38
38
|
}
|