Skip to content

Instantly share code, notes, and snippets.

@tofumatt
Created June 29, 2013 03:51
Show Gist options
  • Save tofumatt/5889645 to your computer and use it in GitHub Desktop.
Save tofumatt/5889645 to your computer and use it in GitHub Desktop.
Example of localForage use
var asyncStorage = require('localForage').asyncStorage;
function displayValue() {
asyncStorage.get('my_key', function(value) {
alert('My value is: ' + value);
});
}
// Notice we do this asynchronously, as all APIs here are async.
asyncStorage.set('my_key', 500, displayValue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment