mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] *: re-add a bunch of tests
This commit is contained in:
committed by
Aaron Bohy
parent
b6eb4d009e
commit
ced5d0f69f
@@ -16,12 +16,12 @@ export function onWillUpdateProps(fn: (nextProps: any) => Promise<void> | void |
|
||||
|
||||
export function onMounted(fn: () => void | any) {
|
||||
const node = getCurrent()!;
|
||||
node.mounted.push(fn);
|
||||
node.mounted.unshift(fn);
|
||||
}
|
||||
|
||||
export function onWillPatch(fn: () => Promise<void> | any | void) {
|
||||
const node = getCurrent()!;
|
||||
node.willPatch.push(fn);
|
||||
node.willPatch.unshift(fn);
|
||||
}
|
||||
|
||||
export function onPatched(fn: () => void | any) {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ export function useRef<C extends Component = Component>(name: string): Ref<C> {
|
||||
return {
|
||||
get el(): HTMLElement | null {
|
||||
const val = node.refs[name];
|
||||
return val!;
|
||||
return val || null;
|
||||
// if (val instanceof HTMLElement) {
|
||||
// return val;
|
||||
// } else if (val instanceof Component) {
|
||||
|
||||
Reference in New Issue
Block a user