isomorfeus-redux 4.0.8 → 4.0.9

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: 7f0e83f5d6221d855a9e65d8ec517d38f259e9aa64c9086d0a373effb20fecda
4
- data.tar.gz: 62cb78e4c7323d5a04dd5e47d4b2dfa2d57d4df26662c9da9235c889c9cc5442
3
+ metadata.gz: 99d3ab5c21d59bd584af72cb907a4b0e4a779f7aaa9adfd999e2eed7afc95d41
4
+ data.tar.gz: b1e58c5bfaaa9e0701f478cc876faccc7c059f199378d5628b387ae75fcbdca7
5
5
  SHA512:
6
- metadata.gz: 543ddf02d83df551c4376674ee23f9698fc54e5b41091eb77760306291cf08537f4f6b012cb1e4a8aad5e0586f813ea4e4d4283b9f8da1304c2d0caf9c78895f
7
- data.tar.gz: 10fa789ede538abef353d0378fbfbf470fae885872f2dd8deabc44ca53ce791d7bc34d2611a07f907cc2c54cb3348bce95d85cdb87cc645c2a7bf67f70403a6e
6
+ metadata.gz: fa45926d6240ecef85ba69f9172ff7abdd6cbcd5da55ad982057f64a9ae5a348a973b5368323958e710db3d00509e5fc3851dd690b78e4baa3fb1ce37fe3df8f
7
+ data.tar.gz: cad72413a2424b6f9aec912d431cc6b55f5770cff34e925c38da915e33b037c417dfd503fe86e964091ccc03d0c4374e895a79bc4294ee46171d1deda8893174
@@ -16,8 +16,6 @@ else
16
16
 
17
17
  Opal.append_path(__dir__.untaint)
18
18
 
19
- if Dir.exist?('isomorfeus')
20
- # Opal.append_path(File.expand_path(File.join('isomorfeus', 'components')))
21
- Opal.append_path(File.expand_path('isomorfeus')) unless Opal.paths.include?(File.expand_path('isomorfeus'))
22
- end
23
- end
19
+ path = File.expand_path('isomorfeus')
20
+ Opal.append_path(path) unless Opal.paths.include?(path)
21
+ end
@@ -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, its set to 'null', so nil or false are ok as final_data
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, its set to 'null', so nil or false are ok as final_data
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();
@@ -1,3 +1,3 @@
1
1
  module Redux
2
- VERSION = '4.0.8'
2
+ VERSION = '4.0.9'
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.0.8
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-07-16 00:00:00.000000000 Z
11
+ date: 2019-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal