File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import type { WatchOptions , WatchSource } from 'vue-demi'
2- import { isRef , watch } from 'vue-demi'
2+ import { isRef , nextTick , watch } from 'vue-demi'
33import { toValue } from '../toValue'
44import type { ElementOf , MaybeRefOrGetter , ShallowUnwrapRef } from '../utils'
55import { promiseTimeout } from '../utils'
@@ -76,7 +76,10 @@ function createUntil<T>(r: any, isNot = false) {
7676 r ,
7777 ( v ) => {
7878 if ( condition ( v ) !== isNot ) {
79- stop ?.( )
79+ if ( stop )
80+ stop ( )
81+ else
82+ nextTick ( ( ) => stop ?.( ) )
8083 resolve ( v )
8184 }
8285 } ,
@@ -111,7 +114,10 @@ function createUntil<T>(r: any, isNot = false) {
111114 [ r , value ] ,
112115 ( [ v1 , v2 ] ) => {
113116 if ( isNot !== ( v1 === v2 ) ) {
114- stop ?.( )
117+ if ( stop )
118+ stop ( )
119+ else
120+ nextTick ( ( ) => stop ?.( ) )
115121 resolve ( v1 )
116122 }
117123 } ,
You can’t perform that action at this time.
0 commit comments