File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,11 @@ function createWatcher(
341
341
}
342
342
343
343
const applyCb = ( n : any , o : any ) => {
344
- if ( isMultiSource && n . every ( ( v : any , i : number ) => Object . is ( v , o [ i ] ) ) )
344
+ if (
345
+ ! deep &&
346
+ isMultiSource &&
347
+ n . every ( ( v : any , i : number ) => Object . is ( v , o [ i ] ) )
348
+ )
345
349
return
346
350
// cleanup before running cb again
347
351
runCleanup ( )
Original file line number Diff line number Diff line change @@ -572,4 +572,14 @@ describe('api: watch', () => {
572
572
await nextTick ( )
573
573
expect ( dummy ) . toEqual ( [ 1 , 2 ] )
574
574
} )
575
+
576
+ // #805 #807
577
+ it ( 'watching sources: [ref<[]>] w/ deep' , async ( ) => {
578
+ const foo = ref ( [ 1 ] )
579
+ const cb = jest . fn ( )
580
+ watch ( [ foo ] , cb , { deep : true } )
581
+ foo . value . push ( 2 )
582
+ await nextTick ( )
583
+ expect ( cb ) . toBeCalledTimes ( 1 )
584
+ } )
575
585
} )
You can’t perform that action at this time.
0 commit comments