view_component_reflex 2.3.14 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +345 -332
- data/app/components/view_component_reflex/component.rb +214 -207
- data/lib/view_component_reflex.rb +10 -10
- data/lib/view_component_reflex/engine.rb +36 -36
- data/lib/view_component_reflex/reflex.rb +147 -147
- data/lib/view_component_reflex/reflex_factory.rb +55 -55
- data/lib/view_component_reflex/state_adapter/memory.rb +25 -25
- data/lib/view_component_reflex/state_adapter/session.rb +24 -24
- data/lib/view_component_reflex/version.rb +3 -3
- metadata +4 -3
@@ -1,24 +1,24 @@
|
|
1
|
-
module ViewComponentReflex
|
2
|
-
module StateAdapter
|
3
|
-
class Session
|
4
|
-
def self.state(request, key)
|
5
|
-
request.session[key] ||= {}
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.set_state(request, controller, key, new_state)
|
9
|
-
new_state.each do |k, v|
|
10
|
-
state(request, key)[k] = v
|
11
|
-
end
|
12
|
-
store = request.session.instance_variable_get("@by")
|
13
|
-
store.commit_session request, controller.response
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.store_state(request, key, new_state = {})
|
17
|
-
request.session[key] = {}
|
18
|
-
new_state.each do |k, v|
|
19
|
-
request.session[key][k] = v
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
1
|
+
module ViewComponentReflex
|
2
|
+
module StateAdapter
|
3
|
+
class Session
|
4
|
+
def self.state(request, key)
|
5
|
+
request.session[key] ||= {}
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.set_state(request, controller, key, new_state)
|
9
|
+
new_state.each do |k, v|
|
10
|
+
state(request, key)[k] = v
|
11
|
+
end
|
12
|
+
store = request.session.instance_variable_get("@by")
|
13
|
+
store.commit_session request, controller.response
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.store_state(request, key, new_state = {})
|
17
|
+
request.session[key] = {}
|
18
|
+
new_state.each do |k, v|
|
19
|
+
request.session[key][k] = v
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module ViewComponentReflex
|
2
|
-
VERSION = '2.
|
3
|
-
end
|
1
|
+
module ViewComponentReflex
|
2
|
+
VERSION = '2.5.0'
|
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: 2.
|
4
|
+
version: 2.5.0
|
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-10-
|
11
|
+
date: 2020-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -96,7 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 2.7.6.2
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
103
|
summary: Allow stimulus reflexes in a view component
|