-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(types): adjust Subscription and Observable types to be easier to consume externally #3328
Changes from all commits
3799e5b
1c59401
97c2284
f359f51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { PartialObserver } from './Observer'; | ||
import { Operator } from './Operator'; | ||
import { Subscriber } from './Subscriber'; | ||
import { Subscription, AnonymousSubscription, TeardownLogic } from './Subscription'; | ||
import { Subscription } from './Subscription'; | ||
import { TeardownLogic } from './types'; | ||
import { root } from './util/root'; | ||
import { toSubscriber } from './util/toSubscriber'; | ||
import { IfObservable } from './observable/IfObservable'; | ||
import { observable as Symbol_observable } from '../internal/symbol/observable'; | ||
import { OperatorFunction, Subscribable } from '../internal/types'; | ||
import { OperatorFunction, PartialObserver, Subscribable } from '../internal/types'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are actually the same reference, and should be merged.
|
||
import { pipeFromArray } from './util/pipe'; | ||
|
||
//TODO(davidd): refactor all references to these to use types instead | ||
export { Subscribable, ObservableLike, SubscribableOrPromise, ObservableInput } from '../internal/types'; | ||
|
||
/** | ||
* A representation of any set of values over any amount of time. This is the most basic building block | ||
* of RxJS. | ||
|
@@ -20,9 +17,12 @@ export { Subscribable, ObservableLike, SubscribableOrPromise, ObservableInput } | |
*/ | ||
export class Observable<T> implements Subscribable<T> { | ||
|
||
/** @internal */ | ||
public _isScalar: boolean = false; | ||
|
||
/** @internal */ | ||
protected source: Observable<any>; | ||
/** @internal */ | ||
protected operator: Operator<any, T>; | ||
|
||
/** | ||
|
@@ -243,6 +243,7 @@ export class Observable<T> implements Subscribable<T> { | |
}); | ||
} | ||
|
||
/** @internal */ | ||
protected _subscribe(subscriber: Subscriber<any>): TeardownLogic { | ||
return this.source.subscribe(subscriber); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ import { Subject, SubjectSubscriber } from '../Subject'; | |
import { Operator } from '../Operator'; | ||
import { Observable } from '../Observable'; | ||
import { Subscriber } from '../Subscriber'; | ||
import { Subscription, TeardownLogic } from '../Subscription'; | ||
import { Subscription } from '../Subscription'; | ||
import { TeardownLogic } from '../types'; | ||
import { refCount as higherOrderRefCount } from '../../internal/operators/refCount'; | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
@@ -13,6 +14,7 @@ export class ConnectableObservable<T> extends Observable<T> { | |
protected _subject: Subject<T>; | ||
protected _refCount: number = 0; | ||
protected _connection: Subscription; | ||
/** @internal */ | ||
_isComplete = false; | ||
|
||
constructor(protected source: Observable<T>, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge
types
imports together.