You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding favorite reservations requires persistent data support. There are basically two ways: Using the serialize method provided by atom API or read and write to a file. Post supporting materials here.
The text was updated successfully, but these errors were encountered:
I've been looking for methods of data persistence. The serialize method provided by atom applies typically to classes, while we need to store a global variable history in our case.
This package provides a way to read from and write to JSON, but I don't know whether it works with local files, for a browser would forbid cross domain access.
Definitely possible to use this. You can write to the file when Atom closes, or even when you copy/cut and then read from it when Atom opens again or initializes.
You might want to take a look at https://nodejs.org/api/fs.html as well. It's what I'm using for the telemetry part so if you take a look at the code I've added to the telemetry, you should have an example on how to implement reading/writing to a file.
Add the package to package.json and then run apm install.
Add fs = require 'fs' to the top of the file where you're declaring the external modules/packages being used.
Add the readFile function call to the init method and then populate the clipboard, and call appendFile whenever you copy something so that it's stored in the file. (Alternately there might be a shutdown or close method by Atom, and you could just copy the entire contents of the clipboard when this is called.)
Adding favorite reservations requires persistent data support. There are basically two ways: Using the serialize method provided by atom API or read and write to a file. Post supporting materials here.
The text was updated successfully, but these errors were encountered: