Skip to content

Commit

Permalink
chore: use ObservableNotification type
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Oct 2, 2020
1 parent 81d2728 commit 2814491
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/internal/Subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @prettier */
import { isFunction } from './util/isFunction';
import { Observer, PartialObserver } from './types';
import { Observer, PartialObserver, ObservableNotification } from './types';
import { isSubscription, Subscription } from './Subscription';
import { config } from './config';
import { reportUnhandledError } from './util/reportUnhandledError';
Expand Down Expand Up @@ -199,10 +199,7 @@ function defaultErrorHandler(err: any) {
* @param notification The notification being sent
* @param subscriber The stopped subscriber
*/
function handleStoppedNotification(
notification: { kind: 'N'; value: any } | { kind: 'E'; error: any } | { kind: 'C' },
subscriber: Subscriber<any>
) {
function handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {
const { onStoppedNotification } = config;
onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
}
Expand Down
6 changes: 2 additions & 4 deletions src/internal/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @prettier */

import { Subscriber } from './Subscriber';
import { ObservableNotification } from './types';

/**
* The global configuration object for RxJS, used to configure things
Expand Down Expand Up @@ -28,9 +28,7 @@ export const config = {
* we do not want errors thrown in this user-configured handler to interfere with the
* behavior of the library.
*/
onStoppedNotification: null as
| ((notification: { kind: 'N'; value: any } | { kind: 'E'; error: any } | { kind: 'C' }, subscriber: Subscriber<any>) => void)
| null,
onStoppedNotification: null as ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null,

/**
* The promise constructor used by default for methods such as
Expand Down

0 comments on commit 2814491

Please sign in to comment.