My package tracks some statistics about the user’s activities (e.g., how many times keys are pressed) and displays a count on the status bar. My initial solution stored this data in an object that was serialized/deserialized when the window was closed/opened, but I just realized that serialized state seems to be specific to an atom window opened for a particular directory. That is, if I run
atom dir1/ the serialized state will be different than if I start it with
atom dir2/. I’m surprised this isn’t mentioned in the docs anywhere (that I can find).
Ideally I want my package state to be stored in one central place so that even if multiple windows are opened, they can all read and edit the data. It looks like I could do this with the
config class and a set of observers. Is that the best practice even for very frequently changing data?