Menu

Our desktop UI throws itself away every time you open the window, and the one thing it keeps is a timestamp in localStorage
📰

Our desktop UI throws itself away every time you open the window, and the one thing it keeps is a timestamp in localStorage

DEV Community: react·Daniel Pertu·about 2 hours ago
#DS7p2HTo
#devtoreact#devto#dev#window#renderer
Reading 0:00
15s threshold

Notifio lives in the system tray. Click the tray icon and a window appears, and because of an empty event handler and a deliberate reload , what appears is a brand new renderer: fresh React tree, fresh state, every component mounting for the first time. The app is on the download page if you want to watch it happen.

When I wrote that post I said the renderer "may not remember anything", and I meant it as an architectural rule: product state belongs to the main process, the window is a view onto it, and anything the window tries to keep is a bug waiting for the next reload.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.