Just as a quick tip: If you need simple key-value-based storage for your plugin, I’ve written a little helper which serves as an abstraction layer for dealing with this.
You can find it at https://github.com/pklaschka/xd-storage-helper. It is MIT-Licensed and automatically serializes “serializable” objects (via
JSON.stringify()). Additionally, instead of returning “null” when nothing is stored, you can pass it a default value that gets returned and saved when nothing was saved in this key (so you don’t have to deal with such special cases if you don’t want to).
It is very easy to use, has JSDoc-comments (so you get help and autocompletion with many IDEs) and is also documented on https://github.com/pklaschka/xd-storage-helper/blob/master/README.md. Therefore, you shouldn’t have any problems using it.
PS: It also got featured in the xd-awesome list (still so happy about that one – I just had to mention it – sorry )