Single Page Apps – Retrieving, Caching Server Requests Using AmplifyJS
You may want to use storage to store data. You can save the data your user has entered in a wizard. Or you might want to save data so you can provide an offline experience. Or you may want to store user preferences. Local storage is a good idea anytime you do not want, or need your user or your application to start all over.
AmplifyJS is a very neat library that provides a consistent API to handle client storage that works in most browsers.
In this post, you will learn to retrieve the data through amplify.request without concern for data caching, server interface, resource location, data types, wrappers, and all the other specificities of the client/server interaction.
Requests made through amplify.request will always be resolved asynchronously, even if the resource invokes the callbacks immediately.
You will probably need jQuery for Amplify Request. The default request type shipped with AmplifyJS does utilize jQuery AJAX, but you can just as easily create a new request type that uses Dojo, MooTools, etc.
However the publish/subscribe and store components do not use jQuery at all.
Continue reading “Single Page Apps – Retrieving, Caching Server Requests Using AmplifyJS”