I have a dynamic form which i m using multiple observables to load data. When all observables emit value, i want to set my form to pristine state. Only problem is that one of my observables is inside of a setTimeout and i cant change that part of code. Is there any alternative way to achieve to set my form to pristine state ?
Here when all observables emit value i m setting the form in pristine state.
combineLatest(this.exceptionTypes$, this.currencyList$, this.priorityList$, this.dataTypeList$, this.escalationLevelList$, this.synchronisationList$)
.subscribe(val => {this.caseOverviewForm.markAsPristine()})
Here is the problem that my last observable inside of the setTimeout and i cant change this. this is effecting combine latest to fire.
private _loadSynchronistionList(): void {
setTimeout(() => {
this.synchronisationList$ = of(SYNCHRONISATION_LIST).pipe(mapAndPatch(this.caseOverviewForm, FormFields.synchronisation, this.detail.id!));
});
}