feat: error handling for setup / render / watch / event handlers

This commit is contained in:
Evan You
2019-08-30 15:05:39 -04:00
parent 1d55b368e8
commit 966d7b5487
11 changed files with 219 additions and 72 deletions

View File

@@ -40,16 +40,3 @@ export const hyphenate = (str: string): string => {
export const capitalize = (str: string): string => {
return str.charAt(0).toUpperCase() + str.slice(1)
}
export function invokeHandlers(
handlers: Function | Function[],
args: any[] = EMPTY_ARR
) {
if (isArray(handlers)) {
for (let i = 0; i < handlers.length; i++) {
handlers[i].apply(null, args)
}
} else {
handlers.apply(null, args)
}
}