statebus 6.1.23 → 6.1.24
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 +1 -1
- package/statebus.js +6 -3
package/package.json
CHANGED
package/statebus.js
CHANGED
|
@@ -430,9 +430,11 @@
|
|
|
430
430
|
statelog(key, yellow, 'v', 'Deleting ' + key)
|
|
431
431
|
// Call the to_delete handlers
|
|
432
432
|
var handlers_called = bus.route(key, 'to_delete', key)
|
|
433
|
-
if (handlers_called === 0)
|
|
433
|
+
if (handlers_called === 0) {
|
|
434
434
|
// And go ahead and delete if there aren't any!
|
|
435
435
|
delete cache[key]
|
|
436
|
+
delete backup_cache[key]
|
|
437
|
+
}
|
|
436
438
|
|
|
437
439
|
// Call the on_delete handlers
|
|
438
440
|
bus.route(key, 'on_delete', cache[key] || {key: key}, t)
|
|
@@ -828,9 +830,10 @@
|
|
|
828
830
|
// except through an explicit .revise() function.
|
|
829
831
|
if (o) t.version = new_version()
|
|
830
832
|
|
|
831
|
-
if (method === 'to_delete')
|
|
833
|
+
if (method === 'to_delete') {
|
|
832
834
|
delete bus.cache[key]
|
|
833
|
-
|
|
835
|
+
delete bus.backup_cache[key]
|
|
836
|
+
} else if (method === 'to_save') {
|
|
834
837
|
bus.save.fire(o || arg, t)
|
|
835
838
|
bus.route(key, 'on_set_sync', o || arg, t)
|
|
836
839
|
} else {
|