view_component_reflex 1.0.0 → 1.0.1

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: f7e9a4ab35ecb85fef158f336121ffd080f26d344bbf804abfc1fd85849b6734
4
- data.tar.gz: 202ab52b2ad27cca0b823cb13d71b0389d6dba68e35e1f92da2ef601a2690125
3
+ metadata.gz: 82d4e40f0f58fd47d6c163e9054b3497eb46ec96a1e963037d96793dbea35530
4
+ data.tar.gz: d169f2e5a7816ee41f56cf033037c61ebb4085b201c85185c8df1cccadbbadb6
5
5
  SHA512:
6
- metadata.gz: aeccacfe56978cc599fabdba202e645950cbf09a52c1a42bcdd12620018a2299a6858c0cda5c13ad644d0e78c766cffef55d46227874ed54d4944c0cef70f042
7
- data.tar.gz: e5e7798417649a6233513a741f7c891e05abe15c941e2ade30bb7a9200b8c9e93039ba54a656cff05bf5a1dab886dd1dfc7bfcc4b42539853ce2cac70857c606
6
+ metadata.gz: 61562e94b88bc140382c480f61e0b9e6afb7024177378978b14fd02a7d2658042fc530798ccafb65cea2092d0438a968b32361afde80b0fb23deea73b2475f5a
7
+ data.tar.gz: b7b4d73cca02d7a2b70d4b43570e09a2a7acede221d9516c29aa68232d421f05cb27da0a743f532369f0db068e01c30c7ed207c426e48a9b2e1fd7857383efab
data/README.md CHANGED
@@ -14,16 +14,16 @@ as any element that stimulates a reflex. ViewComponent is inherently state-less,
14
14
 
15
15
  ### Example
16
16
  ```ruby
17
- # counter_component.rb
18
- class CounterComponent < ViewComponentReflex::Component
19
- def initialize
20
- @count = 0
21
- end
22
-
23
- def increment
24
- @count += 1
25
- end
26
- end
17
+ # counter_component.rb
18
+ class CounterComponent < ViewComponentReflex::Component
19
+ def initialize
20
+ @count = 0
21
+ end
22
+
23
+ def increment
24
+ @count += 1
25
+ end
26
+ end
27
27
  ```
28
28
 
29
29
  ```erb
@@ -7,13 +7,13 @@ module ViewComponentReflex
7
7
  def refresh!(primary_selector = "[data-controller=\"#{stimulus_controller}\"][data-key=\"#{element.dataset[:key]}\"]", *selectors)
8
8
  save_state
9
9
  @channel.send :render_page_and_broadcast_morph, self, [primary_selector, *selectors], {
10
- dataset: element.dataset.to_h,
11
- args: [],
12
- attrs: element.attributes.to_h,
13
- selectors: ["body"],
14
- target: "#{self.class.name}##{method_name}",
15
- url: request.url,
16
- permanentAttributeName: "data-reflex-permanent"
10
+ "dataset" => element.dataset.to_h,
11
+ "args" => [],
12
+ "attrs" => element.attributes.to_h,
13
+ "selectors" => ["body"],
14
+ "target" => "#{self.class.name}##{method_name}",
15
+ "url" => request.url,
16
+ "permanent_attribute_name" => "data-reflex-permanent"
17
17
  }
18
18
  end
19
19
 
@@ -62,7 +62,7 @@ module ViewComponentReflex
62
62
  return @component if @component
63
63
  @component = component_class.allocate
64
64
  reflex = self
65
- exposed_methods = [:element, :refresh!, :refresh_all!, :stimulus_controller]
65
+ exposed_methods = [:params, :request, :element, :refresh!, :refresh_all!, :stimulus_controller]
66
66
  exposed_methods.each do |meth|
67
67
  @component.define_singleton_method(meth) do |*a|
68
68
  reflex.send(meth, *a)
@@ -1,3 +1,3 @@
1
1
  module ViewComponentReflex
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua LeBlanc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-18 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails