Skip to content

Commit

Permalink
feat(jsdoc): Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Oct 31, 2016
1 parent ec051df commit 32413d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 138 deletions.
7 changes: 2 additions & 5 deletions dist/ObservableCursor.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { Observable } from 'rxjs';
/**
* A class represents a Monog.Cursor wrapped with RxJS features.
* @extends Observable
*/
export declare class ObservableCursor<T> extends Observable<T[]> {
private _zone;
private _data;
Expand All @@ -16,7 +12,8 @@ export declare class ObservableCursor<T> extends Observable<T[]> {
* Prefer to create an Cursors from the ObservableCollection instance instead.
*
* @param {Mongo.Cursor<T>} cursor - The Mongo.Cursor to wrap.
* @returns {ObservableCursor<T>} Wrapped Cursor.
* @static
* @returns {ObservableCursor} Wrapped Cursor.
*/
static create<T>(cursor: Mongo.Cursor<T>): ObservableCursor<T>;
/**
Expand Down
7 changes: 2 additions & 5 deletions dist/ObservableCursor.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
'use strict';
import { Observable, Subject } from 'rxjs';
import { gZone, forkZone, removeObserver } from './utils';
/**
* A class represents a Monog.Cursor wrapped with RxJS features.
* @extends Observable
*/
export var ObservableCursor = (function (_super) {
__extends(ObservableCursor, _super);
/**
Expand Down Expand Up @@ -36,7 +32,8 @@ export var ObservableCursor = (function (_super) {
* Prefer to create an Cursors from the ObservableCollection instance instead.
*
* @param {Mongo.Cursor<T>} cursor - The Mongo.Cursor to wrap.
* @returns {ObservableCursor<T>} Wrapped Cursor.
* @static
* @returns {ObservableCursor} Wrapped Cursor.
*/
ObservableCursor.create = function (cursor) {
return new ObservableCursor(cursor);
Expand Down
7 changes: 2 additions & 5 deletions dist/bundles/index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ function removeObserver(observers, observer, onEmpty) {
}
var gZone = g.Zone ? g.Zone.current : fakeZone;

/**
* A class represents a Monog.Cursor wrapped with RxJS features.
* @extends Observable
*/
var ObservableCursor = (function (_super) {
__extends(ObservableCursor, _super);
/**
Expand Down Expand Up @@ -91,7 +87,8 @@ var ObservableCursor = (function (_super) {
* Prefer to create an Cursors from the ObservableCollection instance instead.
*
* @param {Mongo.Cursor<T>} cursor - The Mongo.Cursor to wrap.
* @returns {ObservableCursor<T>} Wrapped Cursor.
* @static
* @returns {ObservableCursor} Wrapped Cursor.
*/
ObservableCursor.create = function (cursor) {
return new ObservableCursor(cursor);
Expand Down
121 changes: 3 additions & 118 deletions docs/ObservableCursor.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,3 @@
## Classes

<dl>
<dt><a href="#ObservableCursor">ObservableCursor</a> ⇐ <code>Observable</code></dt>
<dd><p>A class represents a Monog.Cursor wrapped with RxJS features.</p>
</dd>
<dt><a href="#ObservableCursor">ObservableCursor</a> ⇐ <code>Observable</code></dt>
<dd></dd>
</dl>

<a name="ObservableCursor"></a>

## ObservableCursor ⇐ <code>Observable</code>
A class represents a Monog.Cursor wrapped with RxJS features.

**Kind**: global class
**Extends:** <code>Observable</code>

* [ObservableCursor](#ObservableCursor) ⇐ <code>Observable</code>
* [new ObservableCursor(cursor)](#new_ObservableCursor_new)
* _instance_
* [.cursor](#ObservableCursor+cursor) ⇒ <code>Mongo.Cursor.&lt;T&gt;</code>
* [.collectionCount()](#ObservableCursor+collectionCount) ⇒ <code>Observable</code>
* [.stop()](#ObservableCursor+stop)
* [.dispose()](#ObservableCursor+dispose)
* [.fetch()](#ObservableCursor+fetch) ⇒ <code>Array.&lt;T&gt;</code>
* [.observe(callbacks)](#ObservableCursor+observe) ⇒ <code>Meteor.LiveQueryHandle</code>
* [.observeChanges(callbacks)](#ObservableCursor+observeChanges) ⇒ <code>Meteor.LiveQueryHandle</code>
* _static_
* [.create(cursor)](#ObservableCursor.create) ⇒ <code>ObservableCursor.&lt;T&gt;</code>

<a name="new_ObservableCursor_new"></a>

### new ObservableCursor(cursor)

| Param | Type | Description |
| --- | --- | --- |
| cursor | <code>Mongo.Cursor.&lt;T&gt;</code> | The Mongo.Cursor to wrap. |

<a name="ObservableCursor+cursor"></a>

### observableCursor.cursor ⇒ <code>Mongo.Cursor.&lt;T&gt;</code>
Returns the actual Mongo.Cursor that wrapped by current ObservableCursor instance.

**Kind**: instance property of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>Mongo.Cursor.&lt;T&gt;</code> - The actual MongoDB Cursor.
<a name="ObservableCursor+collectionCount"></a>

### observableCursor.collectionCount() ⇒ <code>Observable</code>
A wrapper for Mongo.Cursor.count() method - returns an Observable of number, which
triggers each time there is a change in the collection, and exposes the number of
objects in the collection.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>Observable</code> - Observable which trigger the callback when the
count of the object changes.
<a name="ObservableCursor+stop"></a>

### observableCursor.stop()
Stops the observation on the cursor.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
<a name="ObservableCursor+dispose"></a>

### observableCursor.dispose()
Clears the Observable definition.
Use this method only when the Observable is still cold, and there are no active subscriptions yet.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
<a name="ObservableCursor+fetch"></a>

### observableCursor.fetch() ⇒ <code>Array.&lt;T&gt;</code>
Return all matching documents as an Array.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>Array.&lt;T&gt;</code> - The array with the matching documents.
<a name="ObservableCursor+observe"></a>

### observableCursor.observe(callbacks) ⇒ <code>Meteor.LiveQueryHandle</code>
Watch a query. Receive callbacks as the result set changes.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>Meteor.LiveQueryHandle</code> - The array with the matching documents.

| Param | Type | Description |
| --- | --- | --- |
| callbacks | <code>Mongo.ObserveCallbacks</code> | The callbacks object. |

<a name="ObservableCursor+observeChanges"></a>

### observableCursor.observeChanges(callbacks) ⇒ <code>Meteor.LiveQueryHandle</code>
Watch a query. Receive callbacks as the result set changes.
Only the differences between the old and new documents are passed to the callbacks.

**Kind**: instance method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>Meteor.LiveQueryHandle</code> - The array with the matching documents.

| Param | Type | Description |
| --- | --- | --- |
| callbacks | <code>Mongo.ObserveChangesCallbacks</code> | The callbacks object. |

<a name="ObservableCursor.create"></a>

### ObservableCursor.create(cursor) ⇒ <code>ObservableCursor.&lt;T&gt;</code>
Static method which creates an ObservableCursor from Mongo.Cursor.
Use this to create an ObservableCursor object from an existing Mongo.Cursor.
Prefer to create an Cursors from the ObservableCollection instance instead.

**Kind**: static method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>ObservableCursor.&lt;T&gt;</code> - Wrapped Cursor.

| Param | Type | Description |
| --- | --- | --- |
| cursor | <code>Mongo.Cursor.&lt;T&gt;</code> | The Mongo.Cursor to wrap. |

<a name="ObservableCursor"></a>

## ObservableCursor ⇐ <code>Observable</code>
Expand All @@ -130,7 +15,7 @@ Static method which creates an ObservableCursor from Mongo.Cursor.
* [.observe(callbacks)](#ObservableCursor+observe) ⇒ <code>Meteor.LiveQueryHandle</code>
* [.observeChanges(callbacks)](#ObservableCursor+observeChanges) ⇒ <code>Meteor.LiveQueryHandle</code>
* _static_
* [.create(cursor)](#ObservableCursor.create) ⇒ <code>ObservableCursor.&lt;T&gt;</code>
* [.create(cursor)](#ObservableCursor.create) ⇒ <code>[ObservableCursor](#ObservableCursor)</code>

<a name="new_ObservableCursor_new"></a>

Expand Down Expand Up @@ -204,13 +89,13 @@ Only the differences between the old and new documents are passed to the callbac

<a name="ObservableCursor.create"></a>

### ObservableCursor.create(cursor) ⇒ <code>ObservableCursor.&lt;T&gt;</code>
### ObservableCursor.create(cursor) ⇒ <code>[ObservableCursor](#ObservableCursor)</code>
Static method which creates an ObservableCursor from Mongo.Cursor.
Use this to create an ObservableCursor object from an existing Mongo.Cursor.
Prefer to create an Cursors from the ObservableCollection instance instead.

**Kind**: static method of <code>[ObservableCursor](#ObservableCursor)</code>
**Returns**: <code>ObservableCursor.&lt;T&gt;</code> - Wrapped Cursor.
**Returns**: <code>[ObservableCursor](#ObservableCursor)</code> - Wrapped Cursor.

| Param | Type | Description |
| --- | --- | --- |
Expand Down
7 changes: 2 additions & 5 deletions src/ObservableCursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import {Observable, Subscriber, Subject} from 'rxjs';
import {gZone, forkZone, removeObserver} from './utils';

/**
* A class represents a Monog.Cursor wrapped with RxJS features.
* @extends Observable
*/
export class ObservableCursor<T> extends Observable<T[]> {
private _zone: Zone;
private _data: Array <T> = [];
Expand All @@ -21,7 +17,8 @@ export class ObservableCursor<T> extends Observable<T[]> {
* Prefer to create an Cursors from the ObservableCollection instance instead.
*
* @param {Mongo.Cursor<T>} cursor - The Mongo.Cursor to wrap.
* @returns {ObservableCursor<T>} Wrapped Cursor.
* @static
* @returns {ObservableCursor} Wrapped Cursor.
*/
static create<T>(cursor: Mongo.Cursor<T>): ObservableCursor<T> {
return new ObservableCursor<T>(cursor);
Expand Down

0 comments on commit 32413d2

Please sign in to comment.