Skip to content

Commit 7a3f0f5

Browse files
committed
bugfix(types): Fixes array type of Observable in find()
1 parent 3802b70 commit 7a3f0f5

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dist/ObservableCollection.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export declare module MongoObservable {
135135
*
136136
* @param {Collection~MongoQuerySelector} selector - A query describing the documents to find
137137
* @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc.
138-
* @returns {ObservableCursor<T[]>} RxJS Observable wrapped with Meteor features.
138+
* @returns {ObservableCursor<T>} RxJS Observable wrapped with Meteor features.
139139
* @example <caption>Using Angular2 Component</caption>
140140
* const MyCollection = MongoObservable.Collection("myCollection");
141141
*
@@ -156,7 +156,7 @@ export declare module MongoObservable {
156156
fields?: FieldSpecifier;
157157
reactive?: boolean;
158158
transform?: Function;
159-
}): ObservableCursor<T[]>;
159+
}): ObservableCursor<T>;
160160
/**
161161
* Finds the first document that matches the selector, as ordered by sort and skip options.
162162
*

dist/ObservableCollection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export var MongoObservable;
182182
*
183183
* @param {Collection~MongoQuerySelector} selector - A query describing the documents to find
184184
* @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc.
185-
* @returns {ObservableCursor<T[]>} RxJS Observable wrapped with Meteor features.
185+
* @returns {ObservableCursor<T>} RxJS Observable wrapped with Meteor features.
186186
* @example <caption>Using Angular2 Component</caption>
187187
* const MyCollection = MongoObservable.Collection("myCollection");
188188
*

dist/bundles/index.umd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ var ObservableCursor = (function (_super) {
397397
*
398398
* @param {Collection~MongoQuerySelector} selector - A query describing the documents to find
399399
* @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc.
400-
* @returns {ObservableCursor<T[]>} RxJS Observable wrapped with Meteor features.
400+
* @returns {ObservableCursor<T>} RxJS Observable wrapped with Meteor features.
401401
* @example <caption>Using Angular2 Component</caption>
402402
* const MyCollection = MongoObservable.Collection("myCollection");
403403
*

docs/ObservableCollection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ T is a generic type - should be used with the type of the objects inside the col
2222
* [.remove(selector)](#Collection+remove) ⇒ <code>Observable.&lt;Number&gt;</code>
2323
* [.update(selector, modifier, options)](#Collection+update) ⇒ <code>Observable.&lt;Number&gt;</code>
2424
* [.upsert(selector, modifier, options)](#Collection+upsert) ⇒ <code>Observable.&lt;{numberAffected, insertedId}&gt;</code>
25-
* [.find(selector, options)](#Collection+find) ⇒ <code>ObservableCursor.&lt;Array.&lt;T&gt;&gt;</code>
25+
* [.find(selector, options)](#Collection+find) ⇒ <code>ObservableCursor.&lt;T&gt;</code>
2626
* [.findOne(selector, options)](#Collection+findOne) ⇒ <code>any</code>
2727
* _inner_
2828
* [~MongoQueryOptions](#Collection..MongoQueryOptions) : <code>Object</code>
@@ -137,11 +137,11 @@ Finds the first document that matches the selector, as ordered by sort and skip
137137

138138
<a name="Collection+find"></a>
139139

140-
### collection.find(selector, options) ⇒ <code>ObservableCursor.&lt;Array.&lt;T&gt;&gt;</code>
140+
### collection.find(selector, options) ⇒ <code>ObservableCursor.&lt;T&gt;</code>
141141
Method has the same notation as Mongo.Collection.find, only returns Observable.
142142

143143
**Kind**: instance method of <code>[Collection](#Collection)</code>
144-
**Returns**: <code>ObservableCursor.&lt;Array.&lt;T&gt;&gt;</code> - RxJS Observable wrapped with Meteor features.
144+
**Returns**: <code>ObservableCursor.&lt;T&gt;</code> - RxJS Observable wrapped with Meteor features.
145145
**See**: [find on Meteor documentation](https://docs.meteor.com/api/collections.html#Mongo-Collection-find)
146146

147147
| Param | Type | Description |

src/ObservableCollection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export module MongoObservable {
228228
*
229229
* @param {Collection~MongoQuerySelector} selector - A query describing the documents to find
230230
* @param {Collection~MongoQueryOptions} options - Query options, such as sort, limit, etc.
231-
* @returns {ObservableCursor<T[]>} RxJS Observable wrapped with Meteor features.
231+
* @returns {ObservableCursor<T>} RxJS Observable wrapped with Meteor features.
232232
* @example <caption>Using Angular2 Component</caption>
233233
* const MyCollection = MongoObservable.Collection("myCollection");
234234
*
@@ -249,10 +249,10 @@ export module MongoObservable {
249249
fields?: FieldSpecifier;
250250
reactive?: boolean;
251251
transform?: Function;
252-
}): ObservableCursor<T[]> {
252+
}): ObservableCursor<T> {
253253
const cursor = this._collection.find.apply(
254254
this._collection, arguments);
255-
return ObservableCursor.create<T[]>(cursor);
255+
return ObservableCursor.create<T>(cursor);
256256
}
257257

258258
/**

0 commit comments

Comments
 (0)