/// >> amplify.request
var amplify = {
request: function( resourceId ) {
/// Decoders allow you to parse an ajax response before calling the success or error callback. This allows you to return data marked with a status and react accordingly. This also allows you to manipulate the data any way you want before passing the data along to the callback.
///
/// Request a resource.
///
Additional Signatures:
///
1. amplify.request( resourceId [, data [, callback ]] )
///
2. amplify.request( settings* )
///
API Reference: http://amplifyjs.com/api/request
///
/// Identifier string for the resource.
/// An object literal of data to be sent to the resource.
/// A function to call once the resource has been retrieved.
///
/// * This parameter is only used with the #2 signature. 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.
///
error (optional): Function to invoke on error.
///
}
///
/// An object containing an 'abort' method
}
};
// stub for vsdoc
amplify.request.decoders = { };
amplify.request.define = function( resourceId, requestType, settings ) {
///
/// Define a resource.
///
Additional Signatures:
///
1. amplify.request.define( resourceId* , resource* )
///
API Reference: http://amplifyjs.com/api/request/#usage
///
/// Identifier string for the resource.
/// The type of data retrieval method from the server. See http://amplifyjs.com/api/request/#request_types for more information.
///
/// A set of key/value pairs that relate to the server communication technology. Any settings found in jQuery.ajax() may be applied to this object.
///
{
///
cache: see the http://amplifyjs.com/api/request/#cache for more details.
///
decoder: see amplify.request.decoders for more details.
///
}
///
/// * This parameter is only used with the #1 additional signature. Identifier string for the resource.
///
/// * This parameter is only used with the #1 additional signature. Function to handle requests. Receives a hash with the following properties:
///
{
///
resourceId: Identifier string for the resource.
///
data: Data provided by the user.
///
success: Callback to invoke on success.
///
error: Callback to invoke on error.
///
}
///
};
/// >> amplify.store
amplify.store = function( key, value, options ) {
///
/// Stores a value for a given key using the default storage type.
///
Additional Signatures:
///
1. amplify.store() - Gets a hash of all stored values.
///
2. amplify.store( string key ) - Gets a stored value based on the key.
///
3. amplify.store( string key, null ) - Clears key/value pair from the store.
///
API Reference: http://amplifyjs.com/api/store
///
/// Identifier for the value being stored.
/// The value to store. The value can be anything that can be serialized as JSON.
/// A set of key/value pairs that relate to settings for storing the value.
/// Depending on the signature used, the method will return the original object/data stored, or undefined.
};
/// >> amplify.pub/sub
amplify.subscribe = function( topic, callback ) {
///
/// Subscribe to a message
///
Additional Signatures:
///
1. amplify.subscribe( topic, context, callback )
///
2. amplify.subscribe( topic, callback, priority )
///
3. amplify.subscribe( topic, context, callback, priority )
///
API Reference: http://amplifyjs.com/api/pubsub
///
/// Name of the message to subscribe to.
/// What this will be when the callback is invoked.
/// Function to invoke when the message is published.
/// Priority relative to other subscriptions for the same message. Lower values have higher priority. Default is 10.
};
amplify.unsubscribe = function( topic, callback ) {
/// Remove a subscription.
/// The topic being unsubscribed from.
/// The callback that was originally subscribed.
};
amplify.publish = function( topic ) {
///
/// Publish a message.
///
Any number of additional parameters can be passed to the subscriptions
///
API Reference: http://amplifyjs.com/api/pubsub
///
/// The name of the message to publish.
/// amplify.publish returns a boolean indicating whether any subscriptions returned false. The return value is true if none of the subscriptions returned false, and false otherwise. Note that only one subscription can return false because doing so will prevent additional subscriptions from being invoked.
};