stimulus_reflex 0.1.12 → 0.2.0
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 +3 -3
- data/README.md +12 -2
- data/app/assets/javascripts/stimulus_reflex.js +1 -1
- data/lib/stimulus_reflex/version.rb +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: 497c626308ac98e461cd46fab1fc85b0eacdbfaa00fd69d5932633b37dcae7d7
|
4
|
+
data.tar.gz: 45c12660b36b162c69f02f8aa1e868d97bb730672a942c8116222a2e26740496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae445693f9ac599962ea2b043186bba99d969540f52be386d2e4c628aad03fed1d1326ffb02f7eb8931a253136d03866d6cfe4986a2c62a66a8446eb8e455a2b
|
7
|
+
data.tar.gz: 5fb5e051e113489b33cdce9c433fa14c41b5881a096927ac9b3ec0a71265c946bca83e65a650a9930745d85aaeb9c09a727cbac685978f34dd15631449ac1b07
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stimulus_reflex (0.
|
4
|
+
stimulus_reflex (0.2.0)
|
5
5
|
actioncable (>= 5.2.1)
|
6
6
|
actionpack (>= 5.2.1)
|
7
7
|
cable_ready (>= 2.0.7)
|
@@ -36,7 +36,7 @@ GEM
|
|
36
36
|
builder (3.2.3)
|
37
37
|
cable_ready (2.0.7)
|
38
38
|
activesupport (>= 5.0.0)
|
39
|
-
concurrent-ruby (1.1.
|
39
|
+
concurrent-ruby (1.1.3)
|
40
40
|
crass (1.0.4)
|
41
41
|
erubi (1.7.1)
|
42
42
|
i18n (1.1.1)
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
nio4r (2.3.1)
|
50
50
|
nokogiri (1.8.5)
|
51
51
|
mini_portile2 (~> 2.3.0)
|
52
|
-
rack (2.0.
|
52
|
+
rack (2.0.6)
|
53
53
|
rack-test (1.1.0)
|
54
54
|
rack (>= 1.0, < 3)
|
55
55
|
rails-dom-testing (2.0.3)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Lines of Code](http://img.shields.io/badge/lines_of_code-
|
1
|
+
[![Lines of Code](http://img.shields.io/badge/lines_of_code-160-brightgreen.svg?style=flat)](http://blog.codinghorror.com/the-best-code-is-no-code-at-all/)
|
2
2
|
[![Maintainability](https://img.shields.io/codeclimate/maintainability/hopsoft/stimulus_reflex.svg)](https://codeclimate.com/github/hopsoft/stimulus_reflex)
|
3
3
|
|
4
4
|
# StimulusReflex
|
@@ -14,7 +14,6 @@ _The goal is to provide 80% of the benefits of SPAs with 20% of the typical effo
|
|
14
14
|
|
15
15
|
```ruby
|
16
16
|
# Gemfile
|
17
|
-
gem "cable_ready"
|
18
17
|
gem "stimulus_reflex"
|
19
18
|
```
|
20
19
|
|
@@ -24,6 +23,15 @@ gem "stimulus_reflex"
|
|
24
23
|
//= require stimulus_reflex
|
25
24
|
```
|
26
25
|
|
26
|
+
```erb
|
27
|
+
<!-- app/views/layouts/application.html.erb -->
|
28
|
+
<!-- Opt-in to establish the ActionCable connection -->
|
29
|
+
<!-- SEE: https://gist.github.com/hopsoft/02dfdf4456b3ac52f4eaf242289bdd36 -->
|
30
|
+
<body data-cable>
|
31
|
+
<%= yield %>
|
32
|
+
</body>
|
33
|
+
```
|
34
|
+
|
27
35
|
```javascript
|
28
36
|
// app/javascript/controllers/example.js
|
29
37
|
import { Controller } from "stimulus"
|
@@ -51,6 +59,8 @@ class ExampleStimulusController < StimulusReflex::Controller
|
|
51
59
|
end
|
52
60
|
```
|
53
61
|
|
62
|
+
Note that ActionCable defaults are expected. This library will use or create `window.App` and `App.cable`.
|
63
|
+
|
54
64
|
## Advanced Usage
|
55
65
|
|
56
66
|
### Page Rerender
|
@@ -1 +1 @@
|
|
1
|
-
window.StimulusReflex=function(e){var t={};function r
|
1
|
+
window.StimulusReflex=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r;n.r(t),n.d(t,"register",function(){return u});document.addEventListener("DOMContentLoaded",function(){document.querySelector("body[data-cable]")&&(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(r),r=setTimeout(function(){CableReady.perform(e.operations)},StimulusReflex.renderDelay||400))}})))});var o={send:function(){if(!App.stimulusReflex)throw"ActionCable connection not established! Don't foget to opt-in with: body[data-cable]";clearTimeout(r);var e=Array.prototype.slice.call(arguments),t=e.shift();App.stimulusReflex.send({url:location.href,target:t,args:e})}},u=function(e){return Object.assign(e,o),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.
|
4
|
+
version: 0.2.0
|
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-11-
|
12
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|