【问题标题】:Initial download of data in firebase on child_changed在 child_changed 上的 firebase 中初始下载数据
【发布时间】:2019-03-03 23:13:47
【问题描述】:

当使用以下方法时

firebaseDb.child('somechile').on('child_changed', cb)

通过在网络选项卡、Web 套接字 (WS) 中的开发人员工具 (chrome) 中观察 Web 套接字连接的帧,我注意到 firebase sdk 下载的整个数据集在启动时存在于“somechild”中监听器(不仅改变)。

这是正确的行为吗? 我期待看到“somechild”中只存在对数据集的更改(即,在启动侦听器时什么都没有)。

任何建议。

【问题讨论】:

    标签: firebase firebase-realtime-database listener


    【解决方案1】:

    firebaser 在这里

    这确实是预期的行为。

    在线上,您只是在观看firebaseDb.child('somechile')child_addedchild_changedvalue 等概念是在此之上的客户端实现。

    【讨论】:

    • 这意味着如果我在'somechild'节点上观看child_changed,我开始下载'somechild'中的所有数据?;我只是想实现滚动实时分页并希望 0- 使用 once(value) 来获取每个页面的数据。 1- 监控 child_change, child_remove 对整个 'somechild' 2- 监控 child_Add on limitTolast(1) 那么,这个策略就没有用了。
    猜你喜欢
    • 1970-01-01
    • 2017-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-09
    • 2013-08-07
    • 2013-11-21
    • 2022-11-30
    相关资源
    最近更新 更多