News for hackers. Stuff that matters.
Re:Offline-First Database Comparison by joshxyz on Tuesday October 26, 2021 @08:43AM (#28999672)
I wonder why multitab isnt supported on watermelon, crosstab updates thru localstorage api works great
Re:Offline-First Database Comparison by radex on Tuesday October 26, 2021 @09:14AM (#28999969)
You can use multiple tabs but to have more than one write to the DB and not be overwritten relies on (online) sync.

The problem is that Watermelon assumes a consistent view of the entire database, so you can't have multiple writers - at least not without synchronous notifications from IndexedDB (not a thing), leader election (cannot be made reliable), or some design sacrifices. To be reconsidered in the future...

Re:Offline-First Database Comparison by franga2000 on Tuesday October 26, 2021 @09:06AM (#28999886)
> WatermelonDB uses the LokiJS adapter which is an in memory database that regularly persists the data to IndexedDB either on interval, or when the browser tab is closed