import { StartAsyncValidationAction } from '../actions' ; import { AbstractControlState , FormState , isFormState } from '../state' ; import { abstractControlReducer , ensureState } from './util' ; /**
 * This update function takes a name and returns a projection function that
 * marks the async validation for the given name as pending.
 */ export function startAsyncValidation ( name ) ; /**
 * This update function takes a form state and a name and marks the async
 * validation for the given name as pending.
 */ export function startAsyncValidation < TValue > ( state , name ) ; export function startAsyncValidation < TValue > ( nameOrState , name ? ) { if ( isFormState ( nameOrState ) ) { return abstractControlReducer ( nameOrState , new StartAsyncValidationAction ( nameOrState . id , name ! ) ) ; } return ( s ) => startAsyncValidation ( ensureState ( s ) , nameOrState ) ; }