view_component_reflex 3.1.5 → 3.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63a22f733ad6878a7014b1b22ea8de86df54d0f1a7be763f7436998970ea8823
4
- data.tar.gz: e2c6b8ef91bf34ed84a974a8a4e2380c589c8d06dbf85475850390bf7966c599
3
+ metadata.gz: 5c4b72c7ca04feca0612b84925248838aa817e75618cbde750f23b60ad6c7802
4
+ data.tar.gz: b9bc83b05e5ff725eb95df9771832d7c28fdd0ab010dd9f27b75ab19c319ce28
5
5
  SHA512:
6
- metadata.gz: 9c231c61349cf8e823f361bd9c2efa768028b2d2c2b794d6f540306068dee0d37fa9d4c72a4e8e8bd6733156f625e320c445dbcd47a6725184755776072612e9
7
- data.tar.gz: 4c5c3727f07b6d9c997386468a13a1c9474e83feb66b0545f27389c9c22e36bac4b33b18b62147e3504fc8f862d60cd35eee36ba1f543d9ad2dcb779be39a502
6
+ metadata.gz: 864da0ee540160df39dfd03970ab52ac8bdfadc4df15eb173aeb301be5e3d507999bb6e4e96bb4095b2245caea8fe0969eebac006a6f5247be9fb2785c105fb1
7
+ data.tar.gz: 993c5c58f8dd8a927cb953f9bb89aa54bd997b9bcb41d07a0a39db7ccc9c71d8faf79cbaf1cf76513b50c5207fe7ef56e268b86ef6c7301d549d99e7b69ec270
@@ -1,4 +1,5 @@
1
1
  require "stimulus_reflex"
2
+ require "view_component_reflex/null_broadcaster"
2
3
  require 'view_component_reflex/reflex_factory'
3
4
  require "view_component_reflex/state_adapter/base"
4
5
  require "view_component_reflex/state_adapter/session"
@@ -0,0 +1,19 @@
1
+ module ViewComponentReflex
2
+ class NullBroadcaster < StimulusReflex::Broadcaster
3
+ def broadcast(_, data)
4
+ nil
5
+ end
6
+
7
+ def nothing?
8
+ true
9
+ end
10
+
11
+ def to_sym
12
+ :nothing
13
+ end
14
+
15
+ def to_s
16
+ "Nothing"
17
+ end
18
+ end
19
+ end
@@ -31,7 +31,7 @@ module ViewComponentReflex
31
31
  else
32
32
  refresh_component!
33
33
  end
34
- CableReady::Channels.instance.broadcast
34
+ CableReady::Channels.instance[stream].broadcast
35
35
  end
36
36
 
37
37
  def stream
@@ -101,6 +101,8 @@ module ViewComponentReflex
101
101
  case selectors
102
102
  when :nothing
103
103
  @broadcaster = StimulusReflex::NothingBroadcaster.new(self)
104
+ when :null
105
+ @broadcaster = NullBroadcaster.new(self)
104
106
  else
105
107
  @broadcaster = StimulusReflex::SelectorBroadcaster.new(self) unless broadcaster.selector?
106
108
  broadcaster.morphs << [selectors, html]
@@ -108,7 +110,7 @@ module ViewComponentReflex
108
110
  end
109
111
 
110
112
  def method_missing(name, *args, &blk)
111
- morph :nothing
113
+ morph :null
112
114
  super unless respond_to_missing?(name)
113
115
  state.each do |k, v|
114
116
  component.instance_variable_set(k, v)
@@ -1,3 +1,3 @@
1
1
  module ViewComponentReflex
2
- VERSION = '3.1.5'
2
+ VERSION = '3.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component_reflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua LeBlanc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-29 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -85,6 +85,7 @@ files:
85
85
  - app/components/view_component_reflex/component.rb
86
86
  - lib/view_component_reflex.rb
87
87
  - lib/view_component_reflex/engine.rb
88
+ - lib/view_component_reflex/null_broadcaster.rb
88
89
  - lib/view_component_reflex/reflex.rb
89
90
  - lib/view_component_reflex/reflex_factory.rb
90
91
  - lib/view_component_reflex/state_adapter/base.rb