Задать вопрос
@frontAng

Как сделать закрытие сокета логичным?

Сейчас отрабатывает функция this.closeSocketConnection(); каждый раз и это очень похоже на работу апи. А не веб сокета. Как исправить?
ngOnInit() {
    this.popupService.openPopup({
      component: AuthComponent
    }).subscribe((res: any) => {
      console.log(res)
      if (res.status) {
        this.loadList();
      } else {
        this.router.navigate(['/main']).then();
      }
    });
  }
  public loadList(page: number = 1): void {
    this.closeSocketConnection();
    this.currentPage$.next(page);
    this.authService
      .testFiltering(params)
      .pipe(takeUntil(this.destroy$))
      .subscribe((response: any) => {
      });
  }
  • Вопрос задан
  • 55 просмотров
Подписаться 1 Средний 5 комментариев
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы