Skip to content

Commit

Permalink
use more exact return type in Notification#do
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Sep 23, 2019
1 parent ffb4b0b commit 8192532
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/internal/Notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export class Notification<T> {

/**
* Given some {@link Observer} callbacks, deliver the value represented by the
* current Notification to the correctly corresponding callback.
* @param {function(value: T): void} next An Observer `next` callback.
* @param {function(err: any): void} [error] An Observer `error` callback.
* @param {function(): void} [complete] An Observer `complete` callback.
* @return {any}
* current Notification to the correctly corresponding callback and return its return value.
* @param {function(value: T): A} next An Observer `next` callback.
* @param {function(err: any): B} [error] An Observer `error` callback.
* @param {function(): C} [complete] An Observer `complete` callback.
* @return {A | B | C} return value of the executed callback.
*/
do(next: (value: T) => void, error?: (err: any) => void, complete?: () => void): any {
do<A = undefined, B = undefined, C = undefined>(next: (value: T) => A, error?: (err: any) => B, complete?: () => C): A | B | C {
const kind = this.kind;
switch (kind) {
case 'N':
Expand Down

0 comments on commit 8192532

Please sign in to comment.