source: trip-planner-front/node_modules/rxjs/src/internal/util/canReportError.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 692 bytes
Line 
1import { Subscriber } from '../Subscriber';
2import { Subject } from '../Subject';
3
4/**
5 * Determines whether the ErrorObserver is closed or stopped or has a
6 * destination that is closed or stopped - in which case errors will
7 * need to be reported via a different mechanism.
8 * @param observer the observer
9 */
10export function canReportError(observer: Subscriber<any> | Subject<any>): boolean {
11 while (observer) {
12 const { closed, destination, isStopped } = observer as any;
13 if (closed || isStopped) {
14 return false;
15 } else if (destination && destination instanceof Subscriber) {
16 observer = destination;
17 } else {
18 observer = null;
19 }
20 }
21 return true;
22}
Note: See TracBrowser for help on using the repository browser.