ref: rename _start to _prepare

This commit is contained in:
Géry Debongnie
2019-04-10 10:45:27 +02:00
parent f960149ba2
commit 90f6808f57
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -220,7 +220,7 @@ export class Component<
}
async mount(target: HTMLElement): Promise<void> {
const vnode = await this._start();
const vnode = await this._prepare();
if (this.__widget__.isDestroyed) {
// widget was destroyed before we get here...
return;
@@ -367,7 +367,7 @@ export class Component<
this.__widget__.vnode = patch(document.createElement(vnode.sel!), vnode);
}
}
async _start(): Promise<VNode> {
async _prepare(): Promise<VNode> {
this.__widget__.renderProps = this.props;
this.__widget__.renderPromise = this.willStart().then(() => {
if (this.__widget__.isDestroyed) {
+1 -1
View File
@@ -1001,7 +1001,7 @@ const widgetDirective: Directive = {
ctx.addLine(`context.refs[${ctx.formatExpression(ref)}] = w${widgetID};`);
}
ctx.addLine(`def${defID} = w${widgetID}._start();`);
ctx.addLine(`def${defID} = w${widgetID}._prepare();`);
ctx.closeIf();
ctx.closeIf();
+3 -3
View File
@@ -47,7 +47,7 @@ exports[`composition sub widgets with some state rendered in a loop 1`] = `
} else {
w7 = new context.widgets['ChildWidget'](owner, props7);
context.__widget__.cmap[key8] = w7.__widget__.id;
def6 = w7._start();
def6 = w7._prepare();
}
}
if (isNew7) {
@@ -95,7 +95,7 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = `
} else {
w4 = new context.widgets['child'](owner, props4);
context.__widget__.cmap[key5] = w4.__widget__.id;
def3 = w4._start();
def3 = w4._prepare();
}
}
if (isNew4) {
@@ -141,7 +141,7 @@ exports[`random stuff/miscellaneous t-props should not be undefined (snapshottin
} else {
w4 = new context.widgets['child'](owner, props4);
context.__widget__.cmap[4] = w4.__widget__.id;
def3 = w4._start();
def3 = w4._prepare();
}
}
if (isNew4) {