【发布时间】:2020-02-29 14:12:50
【问题描述】:
我已经安装了@angular/fire(最新版本5)依赖。
getCustomersList() {
this.customerService.getCustomersList().snapshotChanges().pipe(
map(changes =>
changes.map(c =>
({ key: c.payload.doc.id, ...c.payload.doc.data() })
)
)
).subscribe(customers => {
this.customers = customers;
});
如果我使用F12 打开 Firefox 的“网络”选项卡,我看不到任何网络活动,即使我“神奇地”收到了更改(例如,来自另一个浏览器实例)。但我假设应用程序客户端(位于浏览器中)定期轮询远程数据库:是否以某种方式确认?
哪种机制(在幕后)可以订阅其他地方所做的更改?为什么我不能在浏览器开发者工具中可视化它?由于@angular/fire 在github 上是开源的,有人可以指出代码的相关部分吗?
【问题讨论】:
标签: typescript google-cloud-firestore angularfire2 firefox-developer-tools