Answer the question
In order to leave comments, you need to log in
How does the following code work and what are the two taps for?
There is such a code.
public FormSub$: Subscription;
public Form$: Subject<DynamicForm>;
public Form: FormGroup;
this.Form$ = new Subject<DynamicForm>();
this.Form = new FormGroup({});
ngOnInit(): void {
this.dynamicFormSub$ = this.dynamicFormService.getDynamicForm()
.pipe(
tap(response => this.dynamicForm.next(response)),
tap(response => {}));
}).subscribe();
getDynamicForm(): Observable<DynamicForm> {
return this.http.get<DynamicForm>(`form`, {
})
.pipe(
map(response => this.get(response)),
);
}
this.dynamicFormService.getDynamicForm()
.pipe()).subscribe() {})
}
Answer the question
In order to leave comments, you need to log in
why do we use tap twice and what do we expect on the second tap?
this.dynamicFormSub$ = this.dynamicFormService.getDynamicForm().subscribe(this.dynamicForm);
Why do we use a file read subscription if it only happens once
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question