the core of the library • amplify.publish and amplify.subscribe facilitate the Publish and Subscribe messaging pattern • Someone broadcasts (publish) / Someone else listens (subscribes) • Separating logic allows for loose coupling of your components • Results in less brittle more reusable code
string topic, object context, function callback ); amplify.subscribe( string topic, function callback, number priority); amplify.subscribe( string topic, object context, function callback, number priority); • topic: Name of the message to subscribe to. • [context]: What this will be when the callback is invoked. • callback: Function to invoke when the message is published. • [priority]: Priority relative to other subscriptions for the same message.
systems • Consistent API that handles storage cross-browser • Utilizes latest storage technologies for those browser that have them • Degrades gracefully for browsers without support • Passively/explicitly choose the storage type to use • Serializes to/from JavaScript objects using JSON serialization
options ] ); • key: Identifier for the value being stored. • value: The value to store. The value can be anything that can be serialized as JSON. • [options]: A set of key/value pairs that relate to settings for storing the value.
of request for data • Create and maintain your entire server interface and caching policy in one place by using amplify.request.define • Components that need data use amplify.request without concern for the implementation details that we defined in amplify.request.define • Requests made through amplify.request will always be made asyncronously
string requestType [, hash settings ] ); • resourceId: Identifier string for the resource. • requestType: Type of data retreival method from the server • [settings]: A set of key/value pairs that relate to the requestType.
string resource ); • resourceId: Identifier string for the resource. • resource: Function to handle requests. Receives a hash of settings. • resourceId: Identifier string for the resource. • data: Data provided by the user. • success: Callback to invoke on success. • error: Callback to invoke on error.
[, hash data [, function callback ]] ); • resourceId: Identifier string for the resource. • [data]: A set of key/value pairs of data to be sent to the resource. • [callback]: A function to invoke if the resource is retrieved successfully.
); • settings: A set of key/value pairs of settings for the request. • resourceId: Identifier string for the resource. • data (optional): Data associated with the request. • success (optional): Function to invoke on success.
the length of the page load. • Navigate off or reload and the memory resets. • Persistent Caching requires amplify.store as it is used to store the data in local storage.
based on mockJSON templates. • Using variable data from a MockJSON template keeps your data unpredictable enough to catch edge cases. • Simple API for generating data
specified as @VARIABLENAME - are auto replaced with random data from preset data stores. • Available out of the box. @NUMBER @LETTER_UPPER @LETTER_LOWER @MALE_FIRST_NAME @FEMALE_FIRST_NAME @LAST_NAME @EMAIL @DATE_YYYY @DATE_DD @DATE_MM @TIME_HH @TIME_MM @TIME_SS @LOREM @LOREM_IPSUM