Skip to content

Instantly share code, notes, and snippets.

View attl8d's full-sized avatar

attl8d attl8d

View GitHub Profile
@Humberd
Humberd / async-validator-wrapper.ts
Last active October 26, 2024 08:18
Async Validator Wrapper for Angular 2 Reactive Forms.This wrapper lets you debounce your asyncValidator instead of on every keystroke
import { AbstractControl } from "@angular/forms";
import { Observable } from "rxjs/Observable";
import { Subject } from "rxjs/Subject";
export class QstAsyncValidatorWrapper {
/*
* Angular async validators are triggered on every key stroke.
* This function debounces triggering an async validator.
*