isomorfeus-redux 4.0.8 → 4.0.9
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/isomorfeus-redux.rb +3 -5
- data/lib/redux.rb +7 -3
- 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: 99d3ab5c21d59bd584af72cb907a4b0e4a779f7aaa9adfd999e2eed7afc95d41
|
4
|
+
data.tar.gz: b1e58c5bfaaa9e0701f478cc876faccc7c059f199378d5628b387ae75fcbdca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa45926d6240ecef85ba69f9172ff7abdd6cbcd5da55ad982057f64a9ae5a348a973b5368323958e710db3d00509e5fc3851dd690b78e4baa3fb1ce37fe3df8f
|
7
|
+
data.tar.gz: cad72413a2424b6f9aec912d431cc6b55f5770cff34e925c38da915e33b037c417dfd503fe86e964091ccc03d0c4374e895a79bc4294ee46171d1deda8893174
|
data/lib/isomorfeus-redux.rb
CHANGED
@@ -16,8 +16,6 @@ else
|
|
16
16
|
|
17
17
|
Opal.append_path(__dir__.untaint)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
19
|
+
path = File.expand_path('isomorfeus')
|
20
|
+
Opal.append_path(path) unless Opal.paths.include?(path)
|
21
|
+
end
|
data/lib/redux.rb
CHANGED
@@ -57,7 +57,6 @@ module Redux
|
|
57
57
|
|
58
58
|
def self.fetch_by_path(*path)
|
59
59
|
# get active redux component
|
60
|
-
# (There should be a better way to get the component)
|
61
60
|
%x{
|
62
61
|
var active_component = Opal.React.active_redux_component();
|
63
62
|
var current_state;
|
@@ -71,14 +70,14 @@ module Redux
|
|
71
70
|
current_state = active_component.data_access()
|
72
71
|
if (current_state) {
|
73
72
|
final_data = path.reduce(function(prev, curr) { return prev && prev[curr]; }, current_state);
|
74
|
-
// if final data doesn't exist,
|
73
|
+
// if final data doesn't exist, 'null' is returned, so nil or false are ok as final_data
|
75
74
|
if (final_data !== null && typeof final_data !== "undefined") { return final_data; }
|
76
75
|
}
|
77
76
|
} else {
|
78
77
|
// try to get data from store
|
79
78
|
current_state = Opal.Isomorfeus.store.native.getState();
|
80
79
|
final_data = path.reduce(function(prev, curr) { return prev && prev[curr]; }, current_state);
|
81
|
-
// if final data doesn't exist,
|
80
|
+
// if final data doesn't exist, 'null' is returned, so nil or false are ok as final_data
|
82
81
|
if (final_data !== null && typeof final_data !== "undefined") { return final_data; }
|
83
82
|
}
|
84
83
|
return null;
|
@@ -95,6 +94,11 @@ module Redux
|
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
97
|
+
def self.register_and_fetch_by_path(*path)
|
98
|
+
register_used_store_path(*path)
|
99
|
+
fetch_by_path(*path)
|
100
|
+
end
|
101
|
+
|
98
102
|
def self.register_used_store_path(*path)
|
99
103
|
%x{
|
100
104
|
var active_component = Opal.React.active_redux_component();
|
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.0.
|
4
|
+
version: 4.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|