Skip to content

Commit d932f65

Browse files
committed
regen
1 parent 78d8fb2 commit d932f65

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- remove `setContext()` and `setCtx()`, in favor of `ctx()`.
88

99

10+
## v1.7.0
11+
12+
- support Promise with render
13+
14+
1015
## v1.6.0
1116

1217
- support ctx in nested view with parameters as handlers

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
});
375375
},
376376
_render: function(n, d, i, b, e, initOnly){
377-
var c, init, handler, text, attr, style, action, ref$, k, v, f, results$ = [];
377+
var c, init, handler, text, attr, style, action, ref$, ps, k, v, f;
378378
c = typeof this._ctx === 'function'
379379
? c = this._ctx({
380380
node: this.root,
@@ -441,8 +441,9 @@
441441
if (initOnly) {
442442
return Promise.resolve((d.inited || (d.inited = {}))[n]);
443443
}
444+
ps = [];
444445
if (handler) {
445-
handler(d);
446+
ps.push(handler(d));
446447
}
447448
if (text) {
448449
d.node.textContent = typeof text === 'function' ? text(d) : text;
@@ -467,9 +468,9 @@
467468
continue;
468469
}
469470
setEvtHandler(d, k, f);
470-
results$.push(d.evts[k] = true);
471+
d.evts[k] = true;
471472
}
472-
return results$;
473+
return Promise.all(ps);
473474
} catch (e$) {
474475
e = e$;
475476
console.warn("[ldview] failed when rendering " + n + ":", e);

index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)