Two ways to react on the Electron ‘close’ event

I have an Electron application that needs to save some data when it’s closed by the user (e.g. just after the user clicked on the “Close” button). For this example, we want to store the resolution (width and height of the application in pixels) to a config file. The next time, the application starts, these values should be read and the application resized accordingly.

Read more