isomorfeus-preact 10.6.28 → 10.6.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus_preact/lucid_component/api.rb +19 -7
- data/lib/preact/version.rb +1 -1
- data/lib/preact.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 568b183142ceacc12014377fb018c981eb829354bbedefde4fbaa6afe8e3ffff
|
4
|
+
data.tar.gz: c63fd0c3260e2a2050550b4ae41511c7843dff4a6114e014ede3808f2713d950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abbe6bfcd288626c53f2434a3334cf2b4af9fee57771632ac48ed10679c67b45ce027e4eb2a5c282398f250eaae9a8724dacd9bc1ef07fe1cb309f1376d2f45f
|
7
|
+
data.tar.gz: 1acb14bef1c93928f8727c8841ef9c413ddea9e56a678e155ca04e40c1d3ade6edacfa89bb04c7770bfc61d2d9fe6d1f50a9b833db1f618bb70d695087684df0
|
@@ -16,17 +16,14 @@ module LucidComponent
|
|
16
16
|
`base.preload_block = block`
|
17
17
|
component_did_mount do
|
18
18
|
unless self.state.preloaded
|
19
|
-
@_preload_promise.then { self.state.preloaded = true }
|
20
|
-
err_text = "#{self.class.name}: preloading failed, last result: #{result.nil? ? 'nil' : result}!"
|
21
|
-
`console.error(err_text)`
|
22
|
-
end
|
19
|
+
@_preload_promise.then { self.state.preloaded = true } if @_preload_promise
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
27
24
|
def while_loading(option = nil, &block)
|
28
25
|
wl_block = proc do
|
29
|
-
if @_preload_promise.resolved?
|
26
|
+
if @_preload_promise && @_preload_promise.resolved?
|
30
27
|
instance_exec(&`base.render_block`)
|
31
28
|
else
|
32
29
|
instance_exec(&block)
|
@@ -85,8 +82,23 @@ module LucidComponent
|
|
85
82
|
|
86
83
|
# preloading
|
87
84
|
def execute_preload_block
|
88
|
-
|
89
|
-
|
85
|
+
begin
|
86
|
+
@_preload_promise = instance_exec(&self.class.JS[:preload_block])
|
87
|
+
rescue => e
|
88
|
+
%x{
|
89
|
+
console.error(e.message);
|
90
|
+
console.error(e.stack);
|
91
|
+
}
|
92
|
+
end
|
93
|
+
if @_preload_promise
|
94
|
+
@_preload_promise.fail do |result|
|
95
|
+
err_text = "#{self.class.name}: preloading failed, last result: #{result.nil? ? 'nil' : result}!"
|
96
|
+
`console.error(err_text)`
|
97
|
+
end
|
98
|
+
@_preload_promise.resolved?
|
99
|
+
else
|
100
|
+
false
|
101
|
+
end
|
90
102
|
end
|
91
103
|
|
92
104
|
def preloaded?
|
data/lib/preact/version.rb
CHANGED
data/lib/preact.rb
CHANGED
@@ -216,7 +216,7 @@ module Preact
|
|
216
216
|
if(vnode) {
|
217
217
|
if (vnode.__c && vnode.__c.forceUpdate) { vnode.__c.forceUpdate(); }
|
218
218
|
if (vnode.__k) {
|
219
|
-
for (let i=vnode.__k.length
|
219
|
+
for (let i=0; i<vnode.__k.length; i++) {
|
220
220
|
self.deep_force_update(vnode.__k[i]);
|
221
221
|
}
|
222
222
|
}
|