action_cable_notifications 0.1.24 → 0.1.25

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 778924ed40589e3d7653fa0fa7c7cc7409fbb115
4
- data.tar.gz: dfa866c25e56b55845c2474167742fb4a76592d2
3
+ metadata.gz: 569631f273ec8336e22f450678c5aee4f442da31
4
+ data.tar.gz: 4eb0e60d829d4fe8c383cd5f5ba75c17a7c75cfc
5
5
  SHA512:
6
- metadata.gz: 89bfc86631704c2b812b28f54a0f2238495b7512dc65e3a2432952b62738b4a3c34b348d8f5a286d0d9fdc3d7997f349d19014dee568fe1b8e93955860c0b9fb
7
- data.tar.gz: 585982ecbff391e1edb27a5ebf72cd2d4dfb0c0333931bfa236cac377f494dcea5ea593d4d0d21f2da627ce7a836a4da84d427ecb88955d25331276fbb3e16c7
6
+ metadata.gz: 465a17c5ea141cbc821d20ba746d98dd06b6d20a82a34e3ec72275f75bf9b456ed2851e4df6f68f604602ad2fc8f01b57d22a1c2a83e0c7d1958d933ed39584a
7
+ data.tar.gz: a9086c58a05acd18a17002de7f4271d7407c13419d1f0327246c9341de381e8a13db741e287c80a37f08e505a1c1cc4027197cba899eca367e60aad5e428a45b
@@ -3,7 +3,9 @@
3
3
  #= require './store'
4
4
  #= require './collection'
5
5
 
6
- @CableNotifications =
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.destroy.call(this, selector)
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.id==packet[:id]}
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
@@ -1,3 +1,3 @@
1
1
  module ActionCableNotifications
2
- VERSION = '0.1.24'
2
+ VERSION = '0.1.25'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_cable_notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - ByS Sistemas de Control