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
If JSON was available in all browsers then set and get would be using JSON.stringify/JSON.parse each wrapped in try catch respectively.
store.js doesn't do that by default because it should not be dependent on JSON.js. If you choose to include JSON.js then it's trivial to wrap the library or modify it yourself.
Would be nice to find a way to use JSON.stringify & JSON.parse internally to allow for something like the following:
store.set('user', {name: 'jeff'});
var myobj = store.get('user');
set could detect whether the value is an object and then JSON.stringify
get could attempt a JSON.parse and simply return a string on an exception.
In any case, nice lib :-)
The text was updated successfully, but these errors were encountered: