How you should save/load settings in an app when you want to use the localStorage?
Let's say we just want to save a username and a password.
Currently I know two options:
- using a model with store and proxy.
This seems to be a bit too "big" as you only want to store one object. But you have the advantage to easily use this.load() in the settings FormPanel.
- using the Phonegap or the 'plain' localStorage.
Then you have to use JSON.stringify and JSON.parse but you store only one object and its easier to load it (after a page refresh I run into some trouble using the store and proxy).
But you can't use this.load as you need to load a model. Maybe you need to "cast" the settingsObject from the localStorage to a model and load this one!?
Which approach is better or is there even another, better approach?