Skip to content

Commit

Permalink
docs(operators): fix @return docs after ReactiveX#5729 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jakovljevic-mladen committed Oct 3, 2020
1 parent c19b5f2 commit 15a7d42
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/internal/operators/dematerialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { OperatorSubscriber } from './OperatorSubscriber';
* ```
* @see {@link materialize}
*
* @return {OperatorFunction<Notification<T>, T>} A function that returns an
* @return {OperatorFunction<N, ValueFromNotification<N>>} A function that returns an
* Observable that emits items and notifications embedded in Notification
* objects emitted by the source Observable.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/internal/operators/materialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ import { OperatorSubscriber } from './OperatorSubscriber';
* @see {@link Notification}
* @see {@link dematerialize}
*
* @return {OperatorFunction<T, Notification<T>>} A function that returns an
* Observable that emits {@link Notification} objects that wrap the original
* emissions from the source Observable with metadata.
* @return {OperatorFunction<T, Notification<T> & ObservableNotification<T>>} A
* function that returns an Observable that emits {@link Notification} objects
* that wrap the original emissions from the source Observable with metadata.
*
* @deprecated In version 8, materialize will start to emit {@link ObservableNotification} objects, and not
* {@link Notification} instances. This means that methods that are not commonly used, like `Notification.observe`
Expand Down
8 changes: 4 additions & 4 deletions src/internal/operators/onErrorResumeNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ export function onErrorResumeNext<T, A extends ObservableInput<any>[]>(
* @see {@link concat}
* @see {@link catchError}
*
* @param {...ObservableInput} observables Observables passed either directly or as an array.
* @return {OperatorFunction<T, R>} A function that returns an Observable that
* emits values from source Observable, but - if it errors - subscribes to the
* next passed Observable and so on, until it completes or runs out of
* @param {...ObservableInput} nextSources Observables passed either directly or as an array.
* @return {OperatorFunction<T, unknown>} A function that returns an Observable
* that emits values from source Observable, but - if it errors - subscribes to
* the next passed Observable and so on, until it completes or runs out of
* Observables.
* @name onErrorResumeNext
*/
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/publishBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import { UnaryFunction } from '../types';
* @return {UnaryFunction<Observable<T>, ConnectableObservable<T>>}
* @name publishBehavior
*/
export function publishBehavior<T>(value: T): UnaryFunction<Observable<T>, ConnectableObservable<T>> {
export function publishBehavior<T>(value: T): UnaryFunction<Observable<T>, ConnectableObservable<T>> {
return (source: Observable<T>) => multicast(new BehaviorSubject<T>(value))(source) as ConnectableObservable<T>;
}
2 changes: 1 addition & 1 deletion src/internal/operators/raceWith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function race<T, R>(...observables: Array<Observable<any> | Array<Observa
* Returns an Observable that mirrors the first source Observable to emit a next,
* error or complete notification from the combination of this Observable and supplied Observables.
* @param {...Observables} ...observables Sources used to race for which Observable emits first.
* @return {MonoTypeOperatorFunction<T>} A function that returns an Observable
* @return {OperatorFunction<T, unknown>} A function that returns an Observable
* that mirrors the output of the first Observable to emit an item.
* @name race
* @deprecated Deprecated use {@link raceWith}
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/take.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { OperatorSubscriber } from './OperatorSubscriber';
* @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
*
* @param {number} count The maximum number of `next` values to emit.
* @param count The maximum number of `next` values to emit.
* @return {MonoTypeOperatorFunction<T>} A function that returns an Observable
* that emits only the first `count` values emitted by the source Observable,
* or all of the values from the source if the source emits fewer than `count`
Expand Down
39 changes: 18 additions & 21 deletions src/internal/operators/timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ export function timeout<T>(each: number, scheduler?: SchedulerLike): MonoTypeOpe
*
* ![](timeout.png)
*
* @param config Number specifying period within which Observable must emit
* values or Date specifying before when Observable should complete
* @param schedulerArg Scheduler controlling when timeout checks occur.
*
* @return {MonoTypeOperatorFunction<T>} A function that returns an Observable
* that mirrors behaviour of the source Observable, unless timeout happens when
* it throws an error.
Expand Down Expand Up @@ -366,25 +362,26 @@ export function timeout<T, R, M>(config: number | Date | TimeoutConfig<T, R, M>,
new OperatorSubscriber(
subscriber,
(value: T) => {
// clear the timer so we can emit and start another one.
timerSubscription?.unsubscribe();
seen++;
// Emit
subscriber.next((lastValue = value));
// null | undefined are both < 0. Thanks, JavaScript.
each! > 0 && startTimer(each!);
},
undefined,
undefined,
() => {
if (!timerSubscription?.closed) {
// clear the timer so we can emit and start another one.
timerSubscription?.unsubscribe();
seen++;
// Emit
subscriber.next((lastValue = value));
// null | undefined are both < 0. Thanks, JavaScript.
each! > 0 && startTimer(each!);
},
undefined,
undefined,
() => {
if (!timerSubscription?.closed) {
timerSubscription?.unsubscribe();
}
// Be sure not to hold the last value in memory after unsubscription
// it could be quite large.
lastValue = null;
}
// Be sure not to hold the last value in memory after unsubscription
// it could be quite large.
lastValue = null;
}
)
)

);

// Intentionally terse code.
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/withLatestFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function withLatestFrom<T, R>(array: ObservableInput<any>[], project: (..
* first parameter is a value from the source Observable. (e.g.
* `a.pipe(withLatestFrom(b, c), map(([a1, b1, c1]) => a1 + b1 + c1))`). If this is not
* passed, arrays will be emitted on the output Observable.
* @return {OperatorFunction<T, R>} A function that returns an Observable of
* @return {OperatorFunction<T, R | any[]>} A function that returns an Observable of
* projected values from the most recent values from each input Observable, or
* an array of the most recent values from each input Observable.
* @name withLatestFrom
Expand Down

0 comments on commit 15a7d42

Please sign in to comment.