action_cable_notifications 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/action_cable_notifications/cable_notifications.coffee +6 -1
- data/app/assets/javascripts/action_cable_notifications/collection.coffee +1 -1
- data/lib/action_cable_notifications/channel_cache.rb +1 -1
- data/lib/action_cable_notifications/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 569631f273ec8336e22f450678c5aee4f442da31
|
4
|
+
data.tar.gz: 4eb0e60d829d4fe8c383cd5f5ba75c17a7c75cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465a17c5ea141cbc821d20ba746d98dd06b6d20a82a34e3ec72275f75bf9b456ed2851e4df6f68f604602ad2fc8f01b57d22a1c2a83e0c7d1958d933ed39584a
|
7
|
+
data.tar.gz: a9086c58a05acd18a17002de7f4271d7407c13419d1f0327246c9341de381e8a13db741e287c80a37f08e505a1c1cc4027197cba899eca367e60aad5e428a45b
|
@@ -3,7 +3,9 @@
|
|
3
3
|
#= require './store'
|
4
4
|
#= require './collection'
|
5
5
|
|
6
|
-
@
|
6
|
+
@App || (@App = {})
|
7
|
+
|
8
|
+
@App.cableNotifications =
|
7
9
|
stores: []
|
8
10
|
|
9
11
|
# Register a new store
|
@@ -11,3 +13,6 @@
|
|
11
13
|
new_store = new CableNotifications.Store(store, options, callbacks)
|
12
14
|
@stores.push new_store
|
13
15
|
new_store
|
16
|
+
|
17
|
+
# Backwards compatibility
|
18
|
+
@CableNotifications = @App.cableNotifications
|
@@ -135,7 +135,7 @@ class CableNotifications.Collection
|
|
135
135
|
record = @data[index]
|
136
136
|
if !@sync
|
137
137
|
@data.splice(index, 1)
|
138
|
-
@callbacks
|
138
|
+
@callbacks?.destroy?.call(this, selector)
|
139
139
|
|
140
140
|
upstream.call(this, "destroy", {id: record.id})
|
141
141
|
record
|
@@ -70,7 +70,7 @@ module ActionCableNotifications
|
|
70
70
|
end
|
71
71
|
|
72
72
|
when 'destroy'
|
73
|
-
index = @collections[packet[:collection]].find_index{|c| c
|
73
|
+
index = @collections[packet[:collection]].find_index{|c| c[:id]==packet[:id]}
|
74
74
|
if index
|
75
75
|
@collections[packet[:collection]].delete_at(index)
|
76
76
|
updated = true
|