Prevent infinite looping while using change method of tab component with angularfire library
- 主要语言
- TypeScript
- 星标
- 8.1k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Issue type
**I'm submitting a ...** (check one with "x")
* [x] bug report
### Issue description
**Current behavior:**
I am using Nebular NbTabsetComponent and using (changeTab) event and on every change event I am trying to communicate with the realtime db of firebase using [Angularfire](https://github.com/angular/angularfire) Now when I am using these two in combination, It is constantly tying to hit the database path and infinite loop is forming.
**Expected behavior:**
On change of the tab it should just hit the path only once.
```
loading
onTabClick(tabTitle: string) {
this.loading = true;
// talking to the service to get the data
this.service.serviceMethod()
.pipe(take(1))
.subscribe((data) => {
this.loading = false;
})
}
constructor(private readonly db: AngularFireDatabase) { }
serviceMethod(){
return this.db.list(`/db-path`).valueChanges();
}
贡献指南
评估
这个 Issue 还没有评估数据。