stimulus_reflex 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of stimulus_reflex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/stimulus_reflex/channel.rb +7 -4
- data/lib/stimulus_reflex/version.rb +1 -1
- data/vendor/assets/javascripts/stimulus_reflex.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373ba528084e4de3fef658453750975d991a9eee06aded4bcc6815f3ad388714
|
4
|
+
data.tar.gz: 9aefb07d8817e40fb7b06496327eafc54fa5d06c206a05aac65c3119b54c1216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aad4744401bbeee19eb95a4a65b2394788e1eb2e4d417c407abf2e69b62ba4c01c27165a4d63c81276fc284a41383d5bfca8372b85500a7caa6c8b4f14e16c5
|
7
|
+
data.tar.gz: 4dda36f27627d1010981432b3a465761de082fb1e57e9c0ae4ad9f6acdb95fa794d894778e5412908e6a11e7b35f019528061f00e4546bb9b9b9a3d690633d55
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -31,7 +31,7 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
31
31
|
begin
|
32
32
|
stimulus_controller = stimulus_controller_name.constantize.new(self)
|
33
33
|
delegate_call_to_stimulus_controller stimulus_controller, method_name, arguments
|
34
|
-
render_page_and_broadcast_morph url
|
34
|
+
render_page_and_broadcast_morph url, stimulus_controller
|
35
35
|
rescue StandardError => invoke_error
|
36
36
|
logger.error "StimulusReflex::Channel Failed to invoke #{target}! #{url} #{invoke_error}"
|
37
37
|
end
|
@@ -51,12 +51,12 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def render_page_and_broadcast_morph(url)
|
55
|
-
html = render_page(url)
|
54
|
+
def render_page_and_broadcast_morph(url, stimulus_controller)
|
55
|
+
html = render_page(url, stimulus_controller)
|
56
56
|
broadcast_morph url, html if html.present?
|
57
57
|
end
|
58
58
|
|
59
|
-
def render_page(url)
|
59
|
+
def render_page(url, stimulus_controller)
|
60
60
|
html = nil
|
61
61
|
ActiveSupport::Notifications.instrument "render_page.stimulus_reflex", url: url do
|
62
62
|
uri = URI.parse(url)
|
@@ -64,6 +64,9 @@ class StimulusReflex::Channel < ActionCable::Channel::Base
|
|
64
64
|
controller_class = "#{url_params[:controller]}_controller".classify.constantize
|
65
65
|
controller = controller_class.new
|
66
66
|
controller.instance_variable_set :"@stimulus_reflex", true
|
67
|
+
stimulus_controller.instance_variables.each do |name|
|
68
|
+
controller.instance_variable_set name, stimulus_controller.instance_variable_get(name)
|
69
|
+
end
|
67
70
|
|
68
71
|
env = {
|
69
72
|
Rack::REQUEST_PATH => uri.path,
|
@@ -1 +1 @@
|
|
1
|
-
window.StimulusReflex=function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)r.d(n,u,function(t){return e[t]}.bind(null,u));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n;r.r(t),r.d(t,"register",function(){return o});window.App=window.App||{},App.cable=App.cable||ActionCable.createConsumer(),App.stimulusReflex=App.stimulusReflex||App.cable.subscriptions.create("StimulusReflex::Channel",{received:function(e){e.cableReady&&(clearTimeout(n),n=setTimeout(function(){CableReady.perform(e.operations),document.dispatchEvent(new Event("
|
1
|
+
window.StimulusReflex=function(e){var t={};function r(n){if(t[n])return t[n].exports;var u=t[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)r.d(n,u,function(t){return e[t]}.bind(null,u));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";var n;r.r(t),r.d(t,"register",function(){return o});window.App=window.App||{},App.cable=App.cable||ActionCable.createConsumer(),App.stimulusReflex=App.stimulusReflex||App.cable.subscriptions.create("StimulusReflex::Channel",{received:function(e){e.cableReady&&(clearTimeout(n),n=setTimeout(function(){CableReady.perform(e.operations),document.dispatchEvent(new Event("stimulus_reflex:morph"))},StimulusReflex.renderDelay||400))}});var u={send:function(){clearTimeout(n);var e=Array.prototype.slice.call(arguments),t=e.shift();App.stimulusReflex.send({url:location.href,target:t,args:e})}},o=function(e){return Object.assign(e,u),e}}]);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stimulus_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-10-
|
12
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|