hood.ie 使用 couchDB 方法刷新带有 DB 更改的页面
hood.ie with couchDB method to refresh pages with DB change
我已经开始使用 hood.ie 制作网络应用程序。
我想问一下,有没有一种方便的方法可以在 couch db 中的数据发生变化时刷新页面?
谢谢。
如果您有呈现页面的功能,例如 render
,您可以这样做
hoodie.store.on("change", render)
每当您的数据发生变化时,"change"
事件都会触发,无论是因为您调用了 hoodie.store
API,还是因为从远程同步的更改