(source, value, options)
| 2296 | return watchHandle; |
| 2297 | } |
| 2298 | function instanceWatch(source, value, options) { |
| 2299 | const publicThis = this.proxy; |
| 2300 | const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); |
| 2301 | let cb; |
| 2302 | if (isFunction(value)) { |
| 2303 | cb = value; |
| 2304 | } else { |
| 2305 | cb = value.handler; |
| 2306 | options = value; |
| 2307 | } |
| 2308 | const reset = setCurrentInstance(this); |
| 2309 | const res = doWatch(getter, cb.bind(publicThis), options); |
| 2310 | reset(); |
| 2311 | return res; |
| 2312 | } |
| 2313 | function createPathGetter(ctx, path) { |
| 2314 | const segments = path.split("."); |
| 2315 | return () => { |
nothing calls this directly
no test coverage detected