import { Ref , watch } from 'vue' ; export const watchImmediate = function ( source , callback , options ? ) { if ( ! options ) { options = { } ; } options . immediate = true ; return watch ( source , callback , options ) ; } ; export function untilDefined < T > ( source ) { return new Promise ( ( resolve ) => { const stopHandle = watch ( source , ( value ) => { if ( value !== undefined && value !== null ) { stopHandle ( ) ; resolve ( value ) ; } } ) ; } ) ; }