mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component: reuse widget if possible
Previous code always destroy and recreate widgets.
This commit is contained in:
committed by
VincentSchippefilt
parent
8dc3ec94bf
commit
466c12a0e6
@@ -99,6 +99,7 @@ const NODE_HOOKS_PARAMS = {
|
||||
interface Utils {
|
||||
h: typeof h;
|
||||
objectToAttrString(obj: Object): string;
|
||||
shallowEqual(p1: Object, p2: Object): boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -112,6 +113,14 @@ export const UTILS: Utils = {
|
||||
}
|
||||
}
|
||||
return classes.join(" ");
|
||||
},
|
||||
shallowEqual(p1, p2) {
|
||||
for (let k in p1) {
|
||||
if (p1[k] !== p2[k]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user