isomorfeus-redux 4.1.16 → 4.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/redux/reducers.rb +54 -77
- data/lib/redux/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: 220dc51a83d5f18cace172fb7bc59be39088fd6c737f7f7e8654aa12badac83a
|
4
|
+
data.tar.gz: bca4b194909499cd142e5ea25f3b839cb93897da0951c9295543bd36c1661ffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ca0f077dbca3a6885a2891310a51ac4af9a57cab926551dac0a559ba45e504100da1cd016f4164bbd5f2cf7c69c3a4c190e51ae775a52b60196fa83dac8c06e
|
7
|
+
data.tar.gz: 01f0009e2b8a6496c88c89b19267faeabbf2faa068118ba8d29ae1cae046299321131e6c418664aa2177e53dc9665ff8818251185f3b0c80f6774eefc01ffa9d
|
data/lib/redux/reducers.rb
CHANGED
@@ -1,77 +1,54 @@
|
|
1
|
-
module Redux
|
2
|
-
module Reducers
|
3
|
-
def self.add_application_reducers_to_store
|
4
|
-
unless @_application_reducers_added
|
5
|
-
@_application_reducers_added = true
|
6
|
-
app_reducer = Redux.create_reducer do |prev_state, action|
|
7
|
-
case action[:type]
|
8
|
-
when 'APPLICATION_STATE'
|
9
|
-
if action.key?(:set_state)
|
10
|
-
action[:set_state]
|
11
|
-
else
|
12
|
-
new_state = {}.merge!(prev_state) # make a copy of state
|
13
|
-
if action.key?(:collected)
|
14
|
-
action[:collected].each do |act|
|
15
|
-
new_state.merge!(act[:name] => act[:value])
|
16
|
-
end
|
17
|
-
else
|
18
|
-
new_state.merge!(action[:name] => action[:value])
|
19
|
-
end
|
20
|
-
new_state
|
21
|
-
end
|
22
|
-
else
|
23
|
-
prev_state.nil? ? {} : prev_state
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
|
28
|
-
case action[:type]
|
29
|
-
when '
|
30
|
-
if action.key?(:set_state)
|
31
|
-
action[:set_state]
|
32
|
-
else
|
33
|
-
new_state = {}.merge!(prev_state) # make a copy of state
|
34
|
-
if action.key?(:collected)
|
35
|
-
action[:collected].each do |act|
|
36
|
-
new_state[act[:
|
37
|
-
new_state[act[:
|
38
|
-
end
|
39
|
-
else
|
40
|
-
new_state[action[:
|
41
|
-
new_state[action[:
|
42
|
-
end
|
43
|
-
new_state
|
44
|
-
end
|
45
|
-
else
|
46
|
-
prev_state.nil? ? {} : prev_state
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
else
|
56
|
-
new_state = {}.merge!(prev_state) # make a copy of state
|
57
|
-
if action.key?(:collected)
|
58
|
-
action[:collected].each do |act|
|
59
|
-
new_state[act[:class]] = {} unless new_state.key?(act[:class])
|
60
|
-
new_state[act[:class]].merge!(act[:name] => act[:value])
|
61
|
-
end
|
62
|
-
else
|
63
|
-
new_state[action[:class]] = {} unless new_state.key?(action[:class])
|
64
|
-
new_state[action[:class]].merge!(action[:name] => action[:value])
|
65
|
-
end
|
66
|
-
new_state
|
67
|
-
end
|
68
|
-
else
|
69
|
-
prev_state.nil? ? {} : prev_state
|
70
|
-
end
|
71
|
-
end
|
72
|
-
Redux::Store.preloaded_state_merge!(application_state: {}, instance_state: {}, class_state: {})
|
73
|
-
Redux::Store.add_reducers(application_state: app_reducer, instance_state: instance_reducer, class_state: class_reducer)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
1
|
+
module Redux
|
2
|
+
module Reducers
|
3
|
+
def self.add_application_reducers_to_store
|
4
|
+
unless @_application_reducers_added
|
5
|
+
@_application_reducers_added = true
|
6
|
+
app_reducer = Redux.create_reducer do |prev_state, action|
|
7
|
+
case action[:type]
|
8
|
+
when 'APPLICATION_STATE'
|
9
|
+
if action.key?(:set_state)
|
10
|
+
action[:set_state]
|
11
|
+
else
|
12
|
+
new_state = {}.merge!(prev_state) # make a copy of state
|
13
|
+
if action.key?(:collected)
|
14
|
+
action[:collected].each do |act|
|
15
|
+
new_state.merge!(act[:name] => act[:value])
|
16
|
+
end
|
17
|
+
else
|
18
|
+
new_state.merge!(action[:name] => action[:value])
|
19
|
+
end
|
20
|
+
new_state
|
21
|
+
end
|
22
|
+
else
|
23
|
+
prev_state.nil? ? {} : prev_state
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class_reducer = Redux.create_reducer do |prev_state, action|
|
28
|
+
case action[:type]
|
29
|
+
when 'CLASS_STATE'
|
30
|
+
if action.key?(:set_state)
|
31
|
+
action[:set_state]
|
32
|
+
else
|
33
|
+
new_state = {}.merge!(prev_state) # make a copy of state
|
34
|
+
if action.key?(:collected)
|
35
|
+
action[:collected].each do |act|
|
36
|
+
new_state[act[:class]] = {} unless new_state.key?(act[:class])
|
37
|
+
new_state[act[:class]].merge!(act[:name] => act[:value])
|
38
|
+
end
|
39
|
+
else
|
40
|
+
new_state[action[:class]] = {} unless new_state.key?(action[:class])
|
41
|
+
new_state[action[:class]].merge!(action[:name] => action[:value])
|
42
|
+
end
|
43
|
+
new_state
|
44
|
+
end
|
45
|
+
else
|
46
|
+
prev_state.nil? ? {} : prev_state
|
47
|
+
end
|
48
|
+
end
|
49
|
+
Redux::Store.preloaded_state_merge!(application_state: {}, class_state: {})
|
50
|
+
Redux::Store.add_reducers(application_state: app_reducer, class_state: class_reducer)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/redux/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|