From 7374ae00a100b99eaaa894d0cb48bbbd77280a8c Mon Sep 17 00:00:00 2001 From: Anthony Nahas Date: Tue, 3 Dec 2019 21:17:39 +0100 Subject: [PATCH] fix(package): added debounce time to the component --- .../select-country/src/lib/mat-select-country.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts index d3bb253..5c09d83 100644 --- a/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts +++ b/projects/angular-material-extensions/select-country/src/lib/mat-select-country.component.ts @@ -2,7 +2,7 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {FormControl} from '@angular/forms'; import {COUNTRIES_DB} from './db'; import {Observable} from 'rxjs'; -import {map, startWith} from 'rxjs/operators'; +import {debounceTime, map, startWith} from 'rxjs/operators'; import {MatAutocompleteSelectedEvent, MatFormFieldAppearance} from '@angular/material'; /** @@ -44,6 +44,7 @@ export class MatSelectCountryComponent implements OnInit { this.filteredOptions = this.countryFormControl.valueChanges .pipe( startWith(''), + debounceTime(300), map(value => this._filter(value)) ); }