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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6331ce028802f1b54b7fb887e252eb034ea9a445282d4e560b72c0254afb492b
4
- data.tar.gz: f9bd49e677237be97b152221133c4a0d02e454df2e4bf483fcbe324591fc252a
3
+ metadata.gz: 568b183142ceacc12014377fb018c981eb829354bbedefde4fbaa6afe8e3ffff
4
+ data.tar.gz: c63fd0c3260e2a2050550b4ae41511c7843dff4a6114e014ede3808f2713d950
5
5
  SHA512:
6
- metadata.gz: 98b8ec5095a5723e43742b1ec6ed5dceef4d5735574bb05a475e71fd4a8afec150a2c106ed5b047a06504b1a935c21d458c67ec32301cce308ac825b2839957a
7
- data.tar.gz: b04a6cbfa3e7b3b5d297e7fe5927189e29da30f86b303dcb822d917bdbd9bbf0145fc60ffe470fe2eb560382d68468855ae8037ff7659d511644496bc1afb84c
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 }.fail do |result|
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
- @_preload_promise = instance_exec(&self.class.JS[:preload_block])
89
- @_preload_promise.resolved?
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?
@@ -1,3 +1,3 @@
1
1
  module Preact
2
- VERSION = '10.6.28'
2
+ VERSION = '10.6.29'
3
3
  end
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-1; i>=0; i--) {
219
+ for (let i=0; i<vnode.__k.length; i++) {
220
220
  self.deep_force_update(vnode.__k[i]);
221
221
  }
222
222
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-preact
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.6.28
4
+ version: 10.6.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann