( hook: Function | Function[] | undefined, args: any[] = [], )
| 94 | * with custom HOCs. |
| 95 | */ |
| 96 | const callHook = ( |
| 97 | hook: Function | Function[] | undefined, |
| 98 | args: any[] = [], |
| 99 | ) => { |
| 100 | if (isArray(hook)) { |
| 101 | hook.forEach(h => h(...args)) |
| 102 | } else if (hook) { |
| 103 | hook(...args) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Check if a hook expects a callback (2nd arg), which means the user |
no test coverage detected