view_component_reflex 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/view_component_reflex.rb +0 -12
- data/lib/view_component_reflex/engine.rb +12 -0
- data/lib/view_component_reflex/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5ffa83358af12b225a6a5d4e7fc16a27275e1f2815b2f5e6105a555d7d3faa8
|
4
|
+
data.tar.gz: 2822a3c179dac3550eb1be5c7d30f997cd8942422429d2af92f167880652f28c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f85e4d51fef8d3ba242a48b9b8c3f5c800cbd746582c055d0cb68eba6b6309b2678362fd18b55fec103a1a26d08df728603304ccb5c2f7d0f9bca6c96ce24de6
|
7
|
+
data.tar.gz: 0a9624dff9b4127e59d28ecb0a574186dda9214f772cf332cd23aeca740ef8a3633ff0066d9c8e323fc4c612efb87e81fb9ac24c70aaaab3fc8ece07561bd243
|
@@ -4,15 +4,3 @@ require 'stimulus_reflex'
|
|
4
4
|
module ViewComponentReflex
|
5
5
|
# Your code goes here...
|
6
6
|
end
|
7
|
-
|
8
|
-
module StimulusReflexChannelExtension
|
9
|
-
def render_page_and_broadcast_morph(reflex, selectors, data = {})
|
10
|
-
html = render_page(reflex)
|
11
|
-
if reflex.respond_to? :stimulus_controller
|
12
|
-
selectors = ["[data-controller=\"#{reflex.stimulus_controller}\"]"]
|
13
|
-
end
|
14
|
-
broadcast_morphs selectors, data, html if html.present?
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
StimulusReflex::Channel.include StimulusReflexChannelExtension
|
@@ -1,4 +1,16 @@
|
|
1
1
|
module ViewComponentReflex
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
+
config.to_prepare do
|
4
|
+
class StimulusReflex::Channel < ActionCable::Channel::Base
|
5
|
+
def render_page_and_broadcast_morph(reflex, selectors, data = {})
|
6
|
+
html = render_page(reflex)
|
7
|
+
if reflex.respond_to? :stimulus_controller
|
8
|
+
selectors = ["[data-controller=\"#{reflex.stimulus_controller}\"]"]
|
9
|
+
end
|
10
|
+
broadcast_morphs selectors, data, html if html.present?
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
3
15
|
end
|
4
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua LeBlanc
|
@@ -34,16 +34,16 @@ dependencies:
|
|
34
34
|
name: stimulus_reflex
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: '0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: '0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: view_component
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|