mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] hooks: add onWillPatch and onPatched
This commit also changes the behaviour of willPatch and patched: they no longer transfer data from one to the other, because it can be done cleanly by hooks and a closure. closes #307
This commit is contained in:
@@ -725,10 +725,8 @@ describe("lifecycle hooks", () => {
|
||||
state = useState({ n: 1 });
|
||||
willPatch() {
|
||||
steps.push("parent:willPatch");
|
||||
return "leffe";
|
||||
}
|
||||
patched(snapshot) {
|
||||
expect(snapshot).toBe("leffe");
|
||||
patched() {
|
||||
steps.push("parent:patched");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user