[IMP] components: rename onRender->onWillRender, add onRendered

This commit is contained in:
Géry Debongnie
2021-11-19 09:43:06 +01:00
committed by Aaron Bohy
parent a400fc5e69
commit 629b379ea9
11 changed files with 508 additions and 249 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ import {
Component,
mount,
onPatched,
onRender,
onWillRender,
onWillPatch,
onWillUnmount,
useState,
@@ -37,7 +37,7 @@ describe("reactivity in lifecycle", () => {
static template = xml`<div><t t-esc="state.a"/></div>`;
state = useState({ a: 5, b: 7 });
setup() {
onRender(() => n++);
onWillRender(() => n++);
}
}
const comp = await mount(Comp, fixture);
@@ -61,7 +61,7 @@ describe("reactivity in lifecycle", () => {
`;
state = useState({ n: 2 });
setup() {
onRender(() => {
onWillRender(() => {
steps.push("render");
});
onWillPatch(() => {
@@ -132,7 +132,7 @@ describe("reactivity in lifecycle", () => {
state = useState({ val: 1 });
setup() {
STATE = this.state;
onRender(() => {
onWillRender(() => {
steps.push(this.state.val);
});
}