A Lawnchair
is sorta like a couch except smaller and outside. Perfect for HTML5 mobile apps that need a lightweight, adaptive, simple and elegant persistence solution.
lawnchair
instance is really just an array of objects.Try it! Open Firebug, Web Inspector or pull out your Weinre...
var store = new Lawnchair({name:'testing'}, function(store) {
// Create an object
var me = {key:'brian'};
// Save it
store.save(me);
// Access it later... Yes even after a page refresh!
store.get('brian', function(me) {
console.log(me);
});
});
By default, Lawnchair
will persist using DOM Storage but if other adapters are available and DOM Storage isn't supported by the currently executing JavaScript runtime. Lawnchair
will attempt each successive adapter until it finds one that works. Easy.