Skip to content

Commit

Permalink
refactor: remove subscribeWith
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Jun 9, 2020
1 parent a9eaae8 commit 4bd71f0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 71 deletions.
20 changes: 0 additions & 20 deletions spec/util/subscribeWith-spec.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/internal/operators/finalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Observable } from '../Observable';
import { MonoTypeOperatorFunction, TeardownLogic } from '../types';
import { subscribeWith } from '../util/subscribeWith';

/**
* Returns an Observable that mirrors the source Observable, but will call a specified function when
Expand Down Expand Up @@ -68,7 +67,7 @@ class FinallyOperator<T> implements Operator<T, T> {
}

call(subscriber: Subscriber<T>, source: any): TeardownLogic {
const subscription = subscribeWith(source, subscriber);
const subscription = source.subscribe(subscriber);
subscription.add(this.callback);
return subscription;
}
Expand Down
3 changes: 1 addition & 2 deletions src/internal/util/subscribeToObservable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Subscriber } from '../Subscriber';
import { observable as Symbol_observable } from '../symbol/observable';
import { subscribeWith } from './subscribeWith';

/**
* Subscribes to an object that implements Symbol.observable with the given
Expand All @@ -13,6 +12,6 @@ export const subscribeToObservable = <T>(obj: any) => (subscriber: Subscriber<T>
// Should be caught by observable subscribe function error handling.
throw new TypeError('Provided object does not correctly implement Symbol.observable');
} else {
return subscribeWith(obs, subscriber);
return obs.subscribe(subscriber);
}
};
47 changes: 0 additions & 47 deletions src/internal/util/subscribeWith.ts

This file was deleted.

0 comments on commit 4bd71f0

Please sign in to comment.