From 32413d2431de6e26543acad7323bbe9242f0c0f7 Mon Sep 17 00:00:00 2001 From: Dotan Simha Date: Mon, 31 Oct 2016 13:08:21 +0200 Subject: [PATCH] feat(jsdoc): Updated documentation --- dist/ObservableCursor.d.ts | 7 +-- dist/ObservableCursor.js | 7 +-- dist/bundles/index.umd.js | 7 +-- docs/ObservableCursor.md | 121 +------------------------------------ src/ObservableCursor.ts | 7 +-- 5 files changed, 11 insertions(+), 138 deletions(-) diff --git a/dist/ObservableCursor.d.ts b/dist/ObservableCursor.d.ts index c91d96f1..01ef9dfb 100644 --- a/dist/ObservableCursor.d.ts +++ b/dist/ObservableCursor.d.ts @@ -1,8 +1,4 @@ import { Observable } from 'rxjs'; -/** - * A class represents a Monog.Cursor wrapped with RxJS features. - * @extends Observable - */ export declare class ObservableCursor extends Observable { private _zone; private _data; @@ -16,7 +12,8 @@ export declare class ObservableCursor extends Observable { * Prefer to create an Cursors from the ObservableCollection instance instead. * * @param {Mongo.Cursor} cursor - The Mongo.Cursor to wrap. - * @returns {ObservableCursor} Wrapped Cursor. + * @static + * @returns {ObservableCursor} Wrapped Cursor. */ static create(cursor: Mongo.Cursor): ObservableCursor; /** diff --git a/dist/ObservableCursor.js b/dist/ObservableCursor.js index 42c300e9..317e2f66 100644 --- a/dist/ObservableCursor.js +++ b/dist/ObservableCursor.js @@ -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); /** @@ -36,7 +32,8 @@ export var ObservableCursor = (function (_super) { * Prefer to create an Cursors from the ObservableCollection instance instead. * * @param {Mongo.Cursor} cursor - The Mongo.Cursor to wrap. - * @returns {ObservableCursor} Wrapped Cursor. + * @static + * @returns {ObservableCursor} Wrapped Cursor. */ ObservableCursor.create = function (cursor) { return new ObservableCursor(cursor); diff --git a/dist/bundles/index.umd.js b/dist/bundles/index.umd.js index e8d0d121..596d9aa7 100644 --- a/dist/bundles/index.umd.js +++ b/dist/bundles/index.umd.js @@ -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); /** @@ -91,7 +87,8 @@ var ObservableCursor = (function (_super) { * Prefer to create an Cursors from the ObservableCollection instance instead. * * @param {Mongo.Cursor} cursor - The Mongo.Cursor to wrap. - * @returns {ObservableCursor} Wrapped Cursor. + * @static + * @returns {ObservableCursor} Wrapped Cursor. */ ObservableCursor.create = function (cursor) { return new ObservableCursor(cursor); diff --git a/docs/ObservableCursor.md b/docs/ObservableCursor.md index c903f271..c10488e9 100644 --- a/docs/ObservableCursor.md +++ b/docs/ObservableCursor.md @@ -1,118 +1,3 @@ -## Classes - -
-
ObservableCursorObservable
-

A class represents a Monog.Cursor wrapped with RxJS features.

-
-
ObservableCursorObservable
-
-
- - - -## ObservableCursor ⇐ Observable -A class represents a Monog.Cursor wrapped with RxJS features. - -**Kind**: global class -**Extends:** Observable - -* [ObservableCursor](#ObservableCursor) ⇐ Observable - * [new ObservableCursor(cursor)](#new_ObservableCursor_new) - * _instance_ - * [.cursor](#ObservableCursor+cursor) ⇒ Mongo.Cursor.<T> - * [.collectionCount()](#ObservableCursor+collectionCount) ⇒ Observable - * [.stop()](#ObservableCursor+stop) - * [.dispose()](#ObservableCursor+dispose) - * [.fetch()](#ObservableCursor+fetch) ⇒ Array.<T> - * [.observe(callbacks)](#ObservableCursor+observe) ⇒ Meteor.LiveQueryHandle - * [.observeChanges(callbacks)](#ObservableCursor+observeChanges) ⇒ Meteor.LiveQueryHandle - * _static_ - * [.create(cursor)](#ObservableCursor.create) ⇒ ObservableCursor.<T> - - - -### new ObservableCursor(cursor) - -| Param | Type | Description | -| --- | --- | --- | -| cursor | Mongo.Cursor.<T> | The Mongo.Cursor to wrap. | - - - -### observableCursor.cursor ⇒ Mongo.Cursor.<T> -Returns the actual Mongo.Cursor that wrapped by current ObservableCursor instance. - -**Kind**: instance property of [ObservableCursor](#ObservableCursor) -**Returns**: Mongo.Cursor.<T> - The actual MongoDB Cursor. - - -### observableCursor.collectionCount() ⇒ Observable -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 [ObservableCursor](#ObservableCursor) -**Returns**: Observable - Observable which trigger the callback when the -count of the object changes. - - -### observableCursor.stop() -Stops the observation on the cursor. - -**Kind**: instance method of [ObservableCursor](#ObservableCursor) - - -### 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 [ObservableCursor](#ObservableCursor) - - -### observableCursor.fetch() ⇒ Array.<T> -Return all matching documents as an Array. - -**Kind**: instance method of [ObservableCursor](#ObservableCursor) -**Returns**: Array.<T> - The array with the matching documents. - - -### observableCursor.observe(callbacks) ⇒ Meteor.LiveQueryHandle -Watch a query. Receive callbacks as the result set changes. - -**Kind**: instance method of [ObservableCursor](#ObservableCursor) -**Returns**: Meteor.LiveQueryHandle - The array with the matching documents. - -| Param | Type | Description | -| --- | --- | --- | -| callbacks | Mongo.ObserveCallbacks | The callbacks object. | - - - -### observableCursor.observeChanges(callbacks) ⇒ Meteor.LiveQueryHandle -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 [ObservableCursor](#ObservableCursor) -**Returns**: Meteor.LiveQueryHandle - The array with the matching documents. - -| Param | Type | Description | -| --- | --- | --- | -| callbacks | Mongo.ObserveChangesCallbacks | The callbacks object. | - - - -### ObservableCursor.create(cursor) ⇒ ObservableCursor.<T> -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 [ObservableCursor](#ObservableCursor) -**Returns**: ObservableCursor.<T> - Wrapped Cursor. - -| Param | Type | Description | -| --- | --- | --- | -| cursor | Mongo.Cursor.<T> | The Mongo.Cursor to wrap. | - ## ObservableCursor ⇐ Observable @@ -130,7 +15,7 @@ Static method which creates an ObservableCursor from Mongo.Cursor. * [.observe(callbacks)](#ObservableCursor+observe) ⇒ Meteor.LiveQueryHandle * [.observeChanges(callbacks)](#ObservableCursor+observeChanges) ⇒ Meteor.LiveQueryHandle * _static_ - * [.create(cursor)](#ObservableCursor.create) ⇒ ObservableCursor.<T> + * [.create(cursor)](#ObservableCursor.create) ⇒ [ObservableCursor](#ObservableCursor) @@ -204,13 +89,13 @@ Only the differences between the old and new documents are passed to the callbac -### ObservableCursor.create(cursor) ⇒ ObservableCursor.<T> +### ObservableCursor.create(cursor) ⇒ [ObservableCursor](#ObservableCursor) 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 [ObservableCursor](#ObservableCursor) -**Returns**: ObservableCursor.<T> - Wrapped Cursor. +**Returns**: [ObservableCursor](#ObservableCursor) - Wrapped Cursor. | Param | Type | Description | | --- | --- | --- | diff --git a/src/ObservableCursor.ts b/src/ObservableCursor.ts index 6dcaf915..1a9908a9 100644 --- a/src/ObservableCursor.ts +++ b/src/ObservableCursor.ts @@ -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 extends Observable { private _zone: Zone; private _data: Array = []; @@ -21,7 +17,8 @@ export class ObservableCursor extends Observable { * Prefer to create an Cursors from the ObservableCollection instance instead. * * @param {Mongo.Cursor} cursor - The Mongo.Cursor to wrap. - * @returns {ObservableCursor} Wrapped Cursor. + * @static + * @returns {ObservableCursor} Wrapped Cursor. */ static create(cursor: Mongo.Cursor): ObservableCursor { return new ObservableCursor(cursor);