3 ms·
You can sync localstorage and sessionstorage between tabs, you only have to listen to the right events. I haven’t used indexeddb much, but I’d be surprised if t
by runarberg 4y ago
You can sync localstorage and sessionstorage between tabs, you only have to listen to the right events. I haven’t used indexeddb much, but I’d be surprised if that doesn’t sync between tabs as well. If you are saving all the state in memory—which I think is the default for most popular frameworks—then you’ll have to do something more clever. If you have a backend server as a single source of truth, then you should probably be using websockets if it is vitally important that your users get real updates of new data. I’m sure there are popular react libraries that will handle each of these cases.
It is extra work for sure, but usability improvements usually are, and if you know what you are doing, this will not cost that much extra in maintenance.