Skip to content

Commit

Permalink
chore(canReport): restrict observer type
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Sep 7, 2018
1 parent 1b53211 commit 30440d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/internal/util/canReportError.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { isTrustedSubscriber } from '../Subscriber';
import { ErrorObserver } from '../types';
import { isTrustedSubscriber, Subscriber } from '../Subscriber';
import { Subject } from '../Subject';

/**
* Determines whether the ErrorObserver is closed or stopped or has a
* destination that is closed or stopped - in which case errors will
* need to be reported via a different mechanism.
* @param observer the observer
*/
export function canReportError(observer: ErrorObserver<any>): boolean {
export function canReportError(observer: Subscriber<any> | Subject<any>): boolean {
while (observer) {
const { closed, destination, isStopped } = observer as any;
if (closed || isStopped) {
Expand Down

0 comments on commit 30440d2

Please sign in to comment.