new Collection(client, uri, Ctor [, request])
Creates an instance of Collection.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
client |
ApiClient | A reference to the top-level api client | |
uri |
String | E.g. /api/v1/resources | |
Ctor |
Object | Class of each item in the collection | |
request |
Request |
<optional> |
Fetch API request object |
Methods
-
each(iterator)
-
Parameters:
Name Type Description iteratorfunction Function to call with each resource instance -
subscribe(config)
-
Returns a subscription for this collection. Not all collections support this (only System Log at this time).
Parameters:
Name Type Description configObject Subscription configuration options Properties
Name Type Description intervalNumber Time in ms to wait before checking for more items nextfunction Function to call with each resource instance errorfunction Synchronous function to call with each error. completefunction Function to call when the stream is finished