Quit event?


Is there a quit event that plugins can use to save state or similar, before an Atom window is quit? If so, where’s docs on that?


Serialising? It’s in the flight manual.

It’s also talked about in the package making guide part


“serialization” in no way hints at an “on exit” hook, but now that I read it, I see that it is just what I need. Thanks!

I was wondering because I would like to update the atom-vim-like-tab plugin so that it restores tabs when restarting Atom. This plugin is a nice concept: it lets us make news tabs in which we can have split panes (similar to vim window splits inside tabs).


It’s not. It’s constantly firing, so don’t put anything expensive or prone to breaking noisily in the serialize() method. If Atom is open, it is recording the current state to be restored in the future, and it saves that info to disk automatically in case the program stops working suddenly. It does this through calling all serialize() methods that have been given to it (via registering packages and views).