(fn, type, args)
| 63 | test('call option with error handling', () => { |
| 64 | const onError = vi.fn() |
| 65 | const call: WatchOptions['call'] = function call(fn, type, args) { |
| 66 | if (Array.isArray(fn)) { |
| 67 | fn.forEach(f => call(f, type, args)) |
| 68 | return |
| 69 | } |
| 70 | try { |
| 71 | fn.apply(null, args) |
| 72 | } catch (e) { |
| 73 | onError(e, type) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | watch( |
| 78 | () => { |