new Pipeline(config) → {Object}
Status: Stable
The AeroGear.Pipeline provides a persistence API that is protocol agnostic and does not depend on any certain data model. Through the use of adapters, this library provides common methods like read, save and delete that will just work.
Parameters:
Name | Type | Argument | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
String | Array | Object |
<optional> |
A configuration for the pipe(s) being created along with the Pipeline. If an object or array containing objects is used, the objects can have the following properties:
Properties
|
|||||||||||||||||||||
settings.authorizer |
Object |
<optional> |
null | the AeroGear.authz object used to pass credentials to a secure endpoint | ||||||||||||||||||||
config.settings |
Object |
<optional> |
{} | the settings to be passed to the adapter. For specific settings, see the documentation for the adapter you are using. |
- Source:
Returns:
pipeline - The created Pipeline containing any pipes that may have been created
- Type
- Object
Example
// Create an empty Pipeline
var pl = AeroGear.Pipeline();
// Create a single pipe using the default adapter
var pl2 = AeroGear.Pipeline( "tasks" );
// Create multiple pipes using the default adapter
var pl3 = AeroGear.Pipeline( [ "tasks", "projects" ] );
// Create a new REST pipe with a custom ID using an object
var pl4 = AeroGear.Pipeline({
name: "customPipe",
type: "rest",
settings: {
recordId: "CustomID"
}
});
// Create multiple REST pipes using objects
var pl5 = AeroGear.Pipeline([
{
name: "customPipe",
type: "rest",
settings: {
recordId: "CustomID"
}
},
{
name: "customPipe2",
type: "rest",
settings: {
recordId: "CustomID"
}
}
]);
Extends
- AeroGear.Core
Members
-
<static> adapters
-
The adapters object is provided so that adapters can be added to the AeroGear.Pipeline namespace dynamically and still be accessible to the add method
- Source:
-
<static> this.collectionName :Object
-
The name used to reference the collection of pipe instances created from the adapters
Type:
- Object
- Default Value:
- pipes
- Source: