Files
owl/src/component/handler.ts
T

11 lines
257 B
TypeScript
Raw Normal View History

2020-11-26 16:45:25 +01:00
export function mainEventHandler(data: any, ev: Event) {
if (typeof data === "function") {
data(ev);
} else {
const ctx = data[0];
const method = data[1];
const args = data[2] || [];
ctx.__owl__.component[method](...args, ev);
}
}