amplify.store normal usage.

amplify.store with amplify choosing persistence technology. author(s): The appendTo Team

HTML

<script src="http://github.com/appendto/amplify/raw/master/lib/amplify.core.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/json2/20121008/json2.js"></script>
<script src="http://github.com/appendto/amplify/raw/master/lib/amplify.store.js"></script>
<p></p>

JavaScript

$( function() {

	// with amplify you pick a resource id. and then
	// store an object
	amplify.store( "storeExample1", { foo: "bar" } );

	// or any type of data you'd like
	amplify.store( "storeExample2", "baz" );

	// retrieve the data later via the key
	var myStoredValue = amplify.store( "storeExample1" ),
	myStoredValue2 = amplify.store( "storeExample2" ),
	// you can dump all the stored value into a single hash
	myStoredValues = amplify.store();

	// amplify will take care of serializing/deserializing
	// the data, as well as choosing the best persistance
	// technology available on the client browser.
	$( "p" )
	    .append( myStoredValue.foo ) // bar
	    .append( myStoredValue2 ) // baz
	    .append( myStoredValues.storeExample1.foo ) // bar
	    .append( myStoredValues.storeExample2 ); // baz
});