( instance: ComponentInternalInstance, fn: Function )
| 32 | } |
| 33 | |
| 34 | function wrapHookCall( |
| 35 | instance: ComponentInternalInstance, |
| 36 | fn: Function |
| 37 | ): Function { |
| 38 | return (...args: any) => { |
| 39 | let prev = getCurrentInstance() |
| 40 | setCurrentInstance(instance) |
| 41 | try { |
| 42 | return fn(...args) |
| 43 | } finally { |
| 44 | setCurrentInstance(prev) |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | export const onBeforeMount = createLifeCycle('beforeMount') |
| 50 | export const onMounted = createLifeCycle('mounted') |
no test coverage detected
searching dependent graphs…