Skip to content

Instantly share code, notes, and snippets.

@kborchers
Created January 21, 2013 16:55
Show Gist options
  • Save kborchers/4587415 to your computer and use it in GitHub Desktop.
Save kborchers/4587415 to your computer and use it in GitHub Desktop.
[ "previous", "next" ].forEach( function( element ) {
data[ element ] = (function( pipe, parameters, options ) {
return function( callbacks ) {
options.paging = true;
options.offsetValue = options.limitValue = undefined;
options.query = parameters;
options.success = callbacks && callbacks.success ? callbacks.success : options.success;
options.error = callbacks && callbacks.error ? callbacks.error : options.error;
return pipe.read( options );
};
})( that, links[ pageConfig[ element + "Identifier" ] ], options );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment