Built this and it works. Edge cases and "what if" questions in the comments are welcome — I'm still learning from them.
import { createStore } from "stroid" import "stroid/persist" import "stroid/sync" createStore("cart", { items: [], total: 0 }, { persist: { key: "cart", allowPlaintext: true, version: 1, onStorageC...

Source: DEV Community
import { createStore } from "stroid" import "stroid/persist" import "stroid/sync" createStore("cart", { items: [], total: 0 }, { persist: { key: "cart", allowPlaintext: true, version: 1, onStorageCleared: ({ reason }) => { console.warn("Cart cleared externally:", reason) } }, sync: { channel: "cart-sync", policy: "insecure", conflictResolver: ({ local, incoming, localUpdated, incomingUpdated }) => { return localUpdated > incomingUpdated ? local : incoming } } })