isomorfeus-redux 4.1.16 → 4.1.17

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: 1a46845466bba750b171d19966366ae639b0af9cd91682b5ae80a2778de5ff88
4
- data.tar.gz: 41bd56cf5bc3ef23de58c71c05eec403346eb079b4bd8830d40b61811eb1c873
3
+ metadata.gz: 220dc51a83d5f18cace172fb7bc59be39088fd6c737f7f7e8654aa12badac83a
4
+ data.tar.gz: bca4b194909499cd142e5ea25f3b839cb93897da0951c9295543bd36c1661ffe
5
5
  SHA512:
6
- metadata.gz: 2db38277c88d8492654800bf92b8cba1125d6d2e3cd42ac693fe0fa88ff994c6de3b6d1e3e04c2dc3916294d180d358b8ffc88571e373521886434f963445ea6
7
- data.tar.gz: 28024774eb4559343c6cf2b2fc3545a2815f16445e2a082fb35fbc2837f63bee73f442fbd8e3e0355cfee1108d12c6b706aa03475c86ca150cfde2e4ec3187e2
6
+ metadata.gz: 0ca0f077dbca3a6885a2891310a51ac4af9a57cab926551dac0a559ba45e504100da1cd016f4164bbd5f2cf7c69c3a4c190e51ae775a52b60196fa83dac8c06e
7
+ data.tar.gz: 01f0009e2b8a6496c88c89b19267faeabbf2faa068118ba8d29ae1cae046299321131e6c418664aa2177e53dc9665ff8818251185f3b0c80f6774eefc01ffa9d
@@ -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
- instance_reducer = Redux.create_reducer do |prev_state, action|
28
- case action[:type]
29
- when 'INSTANCE_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[:object_id]] = {} unless new_state.key?(act[:object_id])
37
- new_state[act[:object_id]].merge!(act[:name] => act[:value])
38
- end
39
- else
40
- new_state[action[:object_id]] = {} unless new_state.key?(action[:object_id])
41
- new_state[action[:object_id]].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
-
50
- class_reducer = Redux.create_reducer do |prev_state, action|
51
- case action[:type]
52
- when 'CLASS_STATE'
53
- if action.key?(:set_state)
54
- action[:set_state]
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
@@ -1,3 +1,3 @@
1
1
  module Redux
2
- VERSION = '4.1.16'
2
+ VERSION = '4.1.17'
3
3
  end
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.16
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-15 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal