(name)
| 88 | } |
| 89 | |
| 90 | function makeUseHook(name) { |
| 91 | const list = hooks[name]; |
| 92 | return (hook) => { |
| 93 | validatePlainFunction(hook, `${name}Hook`); |
| 94 | ArrayPrototypePush(list, hook); |
| 95 | update(); |
| 96 | return FunctionPrototypeBind(stop, null, list, hook); |
| 97 | }; |
| 98 | } |
| 99 | |
| 100 | const onInit = makeUseHook('init'); |
| 101 | const onBefore = makeUseHook('before'); |
no test coverage detected