Below is a comparison of the method usage proposed by each lib for handling paged resources.
// Any items marked as "default" could be left out but included for illustration
var pipe = AeroGear.Pipeline({
name: "aerogear",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset", //default
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset", //default
countParam: "limit", //default
countValue: 10,
countIdentifier: "AG-Paging-Limit" //default
}
}
}).pipes.aerogear;
// Any items marked as "default" could be left out but included for illustration
var pipe = AeroGear.Pipeline({
name: "customHeaders",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset", //default
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset-Custom",
countParam: "limit", //default
countValue: 10,
countIdentifier: "AG-Paging-Limit-Custom"
}
}
}).pipes.customHeaders;
###Android
###iOS
###JS
// Any items marked as "default" could be left out but included for illustration
var pipe = AeroGear.Pipeline({
name: "customParams",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset-custom",
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset", //default
countParam: "limit-custom",
countValue: 10,
countIdentifier: "AG-Paging-Limit" //default
}
}
}).pipes.customParams;
// Any items marked as "default" could be left out but included for illustration
var pipes = AeroGear.Pipeline({
name: "contentBodyParams",
settings: {
paging: {
pagingLocation: "content",
pagingType: "page",
locatorParam: "p",
locatorValue: 1,
locatorIdentifier: "page_num",
countParam: "rpp",
countValue: 10,
countIdentifier: "results_per_page"
}
}
});
// Any items marked as "default" could be left out but included for illustration
var pipes = AeroGear.Pipeline([
{
name: "aerogear",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset", //default
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset", //default
countParam: "limit", //default
countValue: 10,
countIdentifier: "AG-Paging-Limit" //default
}
}
},
{
name: "customHeaders",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset", //default
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset-Custom",
countParam: "limit", //default
countValue: 10,
countIdentifier: "AG-Paging-Limit-Custom"
}
}
},
{
name: "customParams",
settings: {
paging: {
pagingLocation: "header", //default
pagingType: "offset", //default
locatorParam: "offset-custom",
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset", //default
countParam: "limit-custom",
countValue: 10,
countIdentifier: "AG-Paging-Limit" //default
}
}
},
{
name: "contentBodyParams",
settings: {
paging: {
pagingLocation: "content",
pagingType: "page",
locatorParam: "p",
locatorValue: 1,
locatorIdentifier: "page_num",
countParam: "rpp",
countValue: 10,
countIdentifier: "results_per_page"
}
}
}
]);
// And a cleaner version without defaults
var cleanPipes = AeroGear.Pipeline([
{
name: "aerogear",
settings: {
paging: {
locatorValue: 0,
countValue: 10
}
}
},
{
name: "customHeaders",
settings: {
paging: {
locatorValue: 0,
locatorIdentifier: "AG-Paging-Offset-Custom",
countValue: 10,
countIdentifier: "AG-Paging-Limit-Custom"
}
}
},
{
name: "customParams",
settings: {
paging: {
locatorParam: "offset-custom",
locatorValue: 0,
countParam: "limit-custom",
countValue: 10
}
}
},
{
name: "contentBodyParams",
settings: {
paging: {
pagingLocation: "content",
pagingType: "page",
locatorParam: "p",
locatorValue: 1,
locatorIdentifier: "page_num",
countParam: "rpp",
countValue: 10,
countIdentifier: "results_per_page"
}
}
}
]);