Opensocial.Collection (v0.9)

Opensocial.Collection (v0.9)

NeedsExamples

opensocial.Collection

Collection of multiple objects with useful accessors. May also represent subset of a larger collection (for example, page 1 of 10) and contain information about the larger collection.

Methods

opensocial.Collection.asArray

;Array.<Object> asArray()

Returns
TypeDescription |

Description
Returns an array of all the objects in this collection.

opensocial.Collection.each

;each(fn)

Parameters
NameTypeDescription |

Description
Executes the provided function once per member of the collection, with each member in turn as the parameter to the function.

opensocial.Collection.getById

;Object? getById(id)

Parameters
NameTypeDescription |

Returns
TypeDescription |

Description
Finds the entry with the given ID value, or returns null if none is found.

opensocial.Collection.getOffset

;Number getOffset()

Returns
TypeDescription |

Description
Gets the offset of this collection within a larger result set.

opensocial.Collection.getTotalSize

;Number getTotalSize()

Returns
TypeDescription |

Description
Gets the total size of the larger result set that this collection belongs to.

opensocial.Collection.size

;Number size()

Returns
TypeDescription |

Description
Gets the size of this collection, which is equal to or less than the total size of the result.

{{ JsApiAlphaList_(v0.9) }}