couchdbhoodie

hood.ie with couchDB method to refresh pages with DB change


I've started using hood.ie to make a web app.

I wanted to ask is there a convenient way to refresh pages whenever data in the couch db changes?

Thanks.


Solution

  • If you have a function that renders your page, like render, you can do this

    hoodie.store.on("change", render)
    

    The "change" event will trigger every time something changes in your data, be it because you called on of the hoodie.store APIs, or because of a changed synced from remote