[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:
Géry Debongnie
2019-09-29 16:47:06 +02:00
parent e82ed7dc8c
commit 367725d194
6 changed files with 269 additions and 51 deletions
+1 -3
View File
@@ -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");
}
}