Skip to content

Commit

Permalink
docs(*): several fixes
Browse files Browse the repository at this point in the history
* docs(bindCallback): fix typo

* docs(bindNodeCallback): fix typo

* docs(max): add missing param name

* docs(min): add missing param name

* docs(multicast): add missing param names

* docs(publish): add missing param name

* docs(repeat): remove non-existent `scheduler` param

* docs(reduce): remove redundant, ignored `@return` tag

* docs(retry): add missing param name and improve description

* docs(repeatWhen): fix docs

Fixes include:

- Remove non-existent `scheduler` param.
- Add missing param name and type for `notifier`.
- Fix some typos.
- Improve description (model after `retryWhen` for consistency).

fixup! docs(repeatWhen): fix docs

* docs(single): add missing param name

* docs(retryWhen): fix docs

Fixes include:

- Remove non-existent `scheduler` param.
- Add missing param name and type for `notifier`.
- Fix some typos.
- Improve description.

* docs(skip): add missing param name

* docs(skipUntil): add missing param name

* docs(startWith): fix docs

Fixes include:

- Add missing, optional param `scheduler`.
- Add missing param name for `values`.
- Change param type (`Values` --> .`..T`) and description (new description based on that of `Observable#of()`).

* docs(subscribeOn): add missing param name

* docs(switchMapTo): remove redundant, ignored `@return` tag

* docs(throw): fix typo

* docs(*): ensure param descriptions are capitalized
  • Loading branch information
gkalpak authored and kwonoj committed Feb 17, 2017
1 parent 77a582e commit 1f78345
Show file tree
Hide file tree
Showing 37 changed files with 90 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/observable/BoundCallbackObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class BoundCallbackObservable<T> extends Observable<T> {
*
* @param {function} func Function with a callback as the last parameter.
* @param {function} [selector] A function which takes the arguments from the
* callback and maps those a value to emit on the output Observable.
* callback and maps those to a value to emit on the output Observable.
* @param {Scheduler} [scheduler] The scheduler on which to schedule the
* callbacks.
* @return {function(...params: *): Observable} A function which returns the
Expand Down
2 changes: 1 addition & 1 deletion src/observable/BoundNodeCallbackObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class BoundNodeCallbackObservable<T> extends Observable<T> {
*
* @param {function} func Function with a callback as the last parameter.
* @param {function} [selector] A function which takes the arguments from the
* callback and maps those a value to emit on the output Observable.
* callback and maps those to a value to emit on the output Observable.
* @param {Scheduler} [scheduler] The scheduler on which to schedule the
* callbacks.
* @return {function(...params: *): Observable} A function which returns the
Expand Down
2 changes: 1 addition & 1 deletion src/observable/ErrorObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ErrorObservable<T> extends Observable<any> {
* var result = Rx.Observable.throw(new Error('oops!')).startWith(7);
* result.subscribe(x => console.log(x), e => console.error(e));
*
* @example <caption>Map and flattens numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>
* @example <caption>Map and flatten numbers to the sequence 'a', 'b', 'c', but throw an error for 13</caption>
* var interval = Rx.Observable.interval(1000);
* var result = interval.mergeMap(x =>
* x === 13 ?
Expand Down
2 changes: 1 addition & 1 deletion src/operator/catch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import { subscribeToResult } from '../util/subscribeToResult';
* @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which
* is the source observable, in case you'd like to "retry" that observable by returning it again. Whatever observable
* is returned by the `selector` will be used to continue the observable chain.
* @return {Observable} an observable that originates from either the source or the observable returned by the
* @return {Observable} An observable that originates from either the source or the observable returned by the
* catch `selector` function.
* @method catch
* @name catch
Expand Down
2 changes: 1 addition & 1 deletion src/operator/concatMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function concatMap<T, I, R>(this: Observable<T>, project: (value: T, inde
* - `innerValue`: the value that came from the projected Observable
* - `outerIndex`: the "index" of the value that came from the source
* - `innerIndex`: the "index" of the value from the projected Observable
* @return {Observable} an observable of values merged from the projected
* @return {Observable} An observable of values merged from the projected
* Observables as they were subscribed to, one at a time. Optionally, these
* values may have been projected from a passed `projectResult` argument.
* @return {Observable} An Observable that emits the result of applying the
Expand Down
6 changes: 3 additions & 3 deletions src/operator/distinct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ import { ISet, Set } from '../util/Set';
* @see {@link distinctUntilChanged}
* @see {@link distinctUntilKeyChanged}
*
* @param {function} [keySelector] optional function to select which value you want to check as distinct.
* @param {Observable} [flushes] optional Observable for flushing the internal HashSet of the operator.
* @return {Observable} an Observable that emits items from the source Observable with distinct values.
* @param {function} [keySelector] Optional function to select which value you want to check as distinct.
* @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator.
* @return {Observable} An Observable that emits items from the source Observable with distinct values.
* @method distinct
* @owner Observable
*/
Expand Down
4 changes: 2 additions & 2 deletions src/operator/distinctUntilChanged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export function distinctUntilChanged<T, K>(this: Observable<T>, compare: (x: K,
* @see {@link distinct}
* @see {@link distinctUntilKeyChanged}
*
* @param {function} [compare] optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} an Observable that emits items from the source Observable with distinct values.
* @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} An Observable that emits items from the source Observable with distinct values.
* @method distinctUntilChanged
* @owner Observable
*/
Expand Down
6 changes: 3 additions & 3 deletions src/operator/distinctUntilKeyChanged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export function distinctUntilKeyChanged<T, K>(this: Observable<T>, key: string,
* @see {@link distinct}
* @see {@link distinctUntilChanged}
*
* @param {string} key string key for object property lookup on each item.
* @param {function} [compare] optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} an Observable that emits items from the source Observable with distinct values based on the key specified.
* @param {string} key String key for object property lookup on each item.
* @param {function} [compare] Optional comparison function called to test if an item is distinct from the previous item in the source.
* @return {Observable} An Observable that emits items from the source Observable with distinct values based on the key specified.
* @method distinctUntilKeyChanged
* @owner Observable
*/
Expand Down
6 changes: 3 additions & 3 deletions src/operator/every.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { Subscriber } from '../Subscriber';
* .every(x => x < 5)
* .subscribe(x => console.log(x)); // -> false
*
* @param {function} predicate a function for determining if an item meets a specified condition.
* @param {any} [thisArg] optional object to use for `this` in the callback
* @return {Observable} an Observable of booleans that determines if all items of the source Observable meet the condition specified.
* @param {function} predicate A function for determining if an item meets a specified condition.
* @param {any} [thisArg] Optional object to use for `this` in the callback.
* @return {Observable} An Observable of booleans that determines if all items of the source Observable meet the condition specified.
* @method every
* @owner Observable
*/
Expand Down
5 changes: 2 additions & 3 deletions src/operator/exhaust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ import { subscribeToResult } from '../util/subscribeToResult';
* @see {@link exhaustMap}
* @see {@link zipAll}
*
* @return {Observable} Returns an Observable that takes a source of Observables
* and propagates the first observable exclusively until it completes before
* subscribing to the next.
* @return {Observable} An Observable that takes a source of Observables and propagates the first observable
* exclusively until it completes before subscribing to the next.
* @method exhaust
* @owner Observable
*/
Expand Down
4 changes: 2 additions & 2 deletions src/operator/finally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Observable } from '../Observable';
/**
* Returns an Observable that mirrors the source Observable, but will call a specified function when
* the source terminates on complete or error.
* @param {function} callback function to be called when source terminates.
* @return {Observable} an Observable that mirrors the source, but will call the specified function on termination.
* @param {function} callback Function to be called when source terminates.
* @return {Observable} An Observable that mirrors the source, but will call the specified function on termination.
* @method finally
* @owner Observable
*/
Expand Down
2 changes: 1 addition & 1 deletion src/operator/first.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function first<T>(this: Observable<T>,
* - `index`: the "index" of the value from the source.
* @param {R} [defaultValue] The default value emitted in case no valid value
* was found on the source.
* @return {Observable<T|R>} an Observable of the first item that matches the
* @return {Observable<T|R>} An Observable of the first item that matches the
* condition.
* @method first
* @owner Observable
Expand Down
8 changes: 4 additions & 4 deletions src/operator/groupBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export function groupBy<T, K, R>(this: Observable<T>, keySelector: (value: T) =>
*
* <img src="./img/groupBy.png" width="100%">
*
* @param {function(value: T): K} keySelector a function that extracts the key
* @param {function(value: T): K} keySelector A function that extracts the key
* for each item.
* @param {function(value: T): R} [elementSelector] a function that extracts the
* @param {function(value: T): R} [elementSelector] A function that extracts the
* return element for each item.
* @param {function(grouped: GroupedObservable<K,R>): Observable<any>} [durationSelector]
* a function that returns an Observable to determine how long each group should
* A function that returns an Observable to determine how long each group should
* exist.
* @return {Observable<GroupedObservable<K,R>>} an Observable that emits
* @return {Observable<GroupedObservable<K,R>>} An Observable that emits
* GroupedObservables, each of which corresponds to a unique key value and each
* of which emits those items from the source Observable that share that key
* value.
Expand Down
2 changes: 1 addition & 1 deletion src/operator/ignoreElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { noop } from '../util/noop';
*
* <img src="./img/ignoreElements.png" width="100%">
*
* @return {Observable} an empty Observable that only calls `complete`
* @return {Observable} An empty Observable that only calls `complete`
* or `error`, based on which one is called by the source Observable.
* @method ignoreElements
* @owner Observable
Expand Down
2 changes: 1 addition & 1 deletion src/operator/isEmpty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Observable } from '../Observable';
*
* <img src="./img/isEmpty.png" width="100%">
*
* @return {Observable} an Observable that emits a Boolean.
* @return {Observable} An Observable that emits a Boolean.
* @method isEmpty
* @owner Observable
*/
Expand Down
4 changes: 2 additions & 2 deletions src/operator/last.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export function last<T>(this: Observable<T>,
*
* @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
* callback if the Observable completes before any `next` notification was sent.
* @param {function} predicate - the condition any source emitted item has to satisfy.
* @return {Observable} an Observable that emits only the last item satisfying the given condition
* @param {function} predicate - The condition any source emitted item has to satisfy.
* @return {Observable} An Observable that emits only the last item satisfying the given condition
* from the source, or an NoSuchElementException if no such items are emitted.
* @throws - Throws if no items that match the predicate are emitted by the source Observable.
* @method last
Expand Down
6 changes: 3 additions & 3 deletions src/operator/max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import { ReduceOperator } from './reduce';
*
* @see {@link min}
*
* @param {Function} optional comparer function that it will use instead of its default to compare the value of two
* items.
* @return {Observable} an Observable that emits item with the largest value.
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
* value of two items.
* @return {Observable} An Observable that emits item with the largest value.
* @method max
* @owner Observable
*/
Expand Down
2 changes: 1 addition & 1 deletion src/operator/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function merge<T, R>(this: Observable<T>, ...observables: Array<Observabl
* Observables being subscribed to concurrently.
* @param {Scheduler} [scheduler=null] The IScheduler to use for managing
* concurrency of input Observables.
* @return {Observable} an Observable that emits items that are the result of
* @return {Observable} An Observable that emits items that are the result of
* every input Observable.
* @method merge
* @owner Observable
Expand Down
5 changes: 3 additions & 2 deletions src/operator/min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import { ReduceOperator } from './reduce';
*
* @see {@link max}
*
* @param {Function} optional comparer function that it will use instead of its default to compare the value of two items.
* @return {Observable<R>} an Observable that emits item with the smallest value.
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
* value of two items.
* @return {Observable<R>} An Observable that emits item with the smallest value.
* @method min
* @owner Observable
*/
Expand Down
6 changes: 3 additions & 3 deletions src/operator/multicast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export function multicast<T>(SubjectFactory: (this: Observable<T>) => Subject<T>
*
* <img src="./img/multicast.png" width="100%">
*
* @param {Function|Subject} Factory function to create an intermediate subject through
* @param {Function|Subject} subjectOrSubjectFactory - Factory function to create an intermediate subject through
* which the source sequence's elements will be multicast to the selector function
* or Subject to push source elements into.
* @param {Function} Optional selector function that can use the multicasted source stream
* @param {Function} [selector] - Optional selector function that can use the multicasted source stream
* as many times as needed, without causing multiple subscriptions to the source stream.
* Subscribers to the given source will receive all notifications of the source from the
* time of the subscription forward.
* @return {Observable} an Observable that emits the results of invoking the selector
* @return {Observable} An Observable that emits the results of invoking the selector
* on the items emitted by a `ConnectableObservable` that shares a single subscription to
* the underlying stream.
* @method multicast
Expand Down
3 changes: 1 addition & 2 deletions src/operator/pluck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { map } from './map';
*
* @param {...string} properties The nested properties to pluck from each source
* value (an object).
* @return {Observable} Returns a new Observable of property values from the
* source values.
* @return {Observable} A new Observable of property values from the source values.
* @method pluck
* @owner Observable
*/
Expand Down
6 changes: 3 additions & 3 deletions src/operator/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export function publish<T>(this: Observable<T>, selector: selector<T>): Observab
*
* <img src="./img/publish.png" width="100%">
*
* @param {Function} Optional selector function which can use the multicasted source sequence as many times as needed,
* without causing multiple subscriptions to the source sequence.
* @param {Function} [selector] - Optional selector function which can use the multicasted source sequence as many times
* as needed, without causing multiple subscriptions to the source sequence.
* Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @return a ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.
* @return A ConnectableObservable that upon connection causes the source Observable to emit items to its Observers.
* @method publish
* @owner Observable
*/
Expand Down
6 changes: 3 additions & 3 deletions src/operator/race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function race<T, R>(this: Observable<T>, ...observables: Array<Observable

/**
* Returns an Observable that mirrors the first source Observable to emit an item
* from the combination of this Observable and supplied Observables
* @param {...Observables} ...observables sources used to race for which Observable emits first.
* @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.
* from the combination of this Observable and supplied Observables.
* @param {...Observables} ...observables Sources used to race for which Observable emits first.
* @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.
* @method race
* @owner Observable
*/
Expand Down
1 change: 0 additions & 1 deletion src/operator/reduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function reduce<T, R>(this: Observable<T>, accumulator: (acc: R, value: T
* @param {function(acc: R, value: T, index: number): R} accumulator The accumulator function
* called on each source value.
* @param {R} [seed] The initial accumulation value.
* @return {Observable<R>} An observable of the accumulated values.
* @return {Observable<R>} An Observable that emits a single value that is the
* result of accumulating the values emitted by the source Observable.
* @method reduce
Expand Down
7 changes: 3 additions & 4 deletions src/operator/repeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { EmptyObservable } from '../observable/EmptyObservable';
import { TeardownLogic } from '../Subscription';

/**
* Returns an Observable that repeats the stream of items emitted by the source Observable at most count times,
* on a particular IScheduler.
* Returns an Observable that repeats the stream of items emitted by the source Observable at most count times.
*
* <img src="./img/repeat.png" width="100%">
*
* @param {number} [count] the number of times the source Observable items are repeated, a count of 0 will yield
* @param {number} [count] The number of times the source Observable items are repeated, a count of 0 will yield
* an empty Observable.
* @return {Observable} an Observable that repeats the stream of items emitted by the source Observable at most
* @return {Observable} An Observable that repeats the stream of items emitted by the source Observable at most
* count times.
* @method repeat
* @owner Observable
Expand Down
16 changes: 7 additions & 9 deletions src/operator/repeatWhen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';

/**
* Returns an Observable that emits the same values as the source observable with the exception of a `complete`.
* A `complete` will cause the emission of the Throwable that cause the complete to the Observable returned from
* notificationHandler. If that Observable calls onComplete or `complete` then retry will call `complete` or `error`
* on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a particular
* IScheduler.
* Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source
* Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable
* calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise
* this method will resubscribe to the source Observable.
*
* <img src="./img/repeatWhen.png" width="100%">
*
* @param {notificationHandler} receives an Observable of notifications with which a user can `complete` or `error`,
* aborting the retry.
* @param {scheduler} the IScheduler on which to subscribe to the source Observable.
* @return {Observable} the source Observable modified with retry logic.
* @param {function(notifications: Observable): Observable} notifier - Receives an Observable of notifications with
* which a user can `complete` or `error`, aborting the repetition.
* @return {Observable} The source Observable modified with repeat logic.
* @method repeatWhen
* @owner Observable
*/
Expand Down
11 changes: 5 additions & 6 deletions src/operator/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ import { Observable } from '../Observable';
import { TeardownLogic } from '../Subscription';

/**
* Returns an Observable that mirrors the source Observable, resubscribing to it if it calls `error` and the
* predicate returns true for that specific exception and retry count.
* If the source Observable calls `error`, this method will resubscribe to the source Observable for a maximum of
* count resubscriptions (given as a number parameter) rather than propagating the `error` call.
* Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
* calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given
* as a number parameter) rather than propagating the `error` call.
*
* <img src="./img/retry.png" width="100%">
*
* Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted
* during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second
* time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications
* would be: [1, 2, 1, 2, 3, 4, 5, `complete`].
* @param {number} number of retry attempts before failing.
* @return {Observable} the source Observable modified with the retry logic.
* @param {number} count - Number of retry attempts before failing.
* @return {Observable} The source Observable modified with the retry logic.
* @method retry
* @owner Observable
*/
Expand Down
Loading

0 comments on commit 1f78345

Please sign in to comment.