News for hackers. Stuff that matters.
Re:If it goes somewhere, it’s a link. If it does something, ... by runarberg on Wednesday October 12, 2022 @01:14AM (#33173149)
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.

There are no comments on this comment yet.