Skip to content
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

fix(Observable): align type definition of subscriber with Observable #2196

Merged
merged 1 commit into from
Jan 29, 2017

Conversation

kwonoj
Copy link
Member

@kwonoj kwonoj commented Dec 15, 2016

Description:
This PR align type of subscriber param to <T>, same as observable.

Related issue (if exists):

@kwonoj kwonoj added the TS Issues and PRs related purely to TypeScript issues label Dec 15, 2016
@kwonoj
Copy link
Member Author

kwonoj commented Dec 15, 2016

What would be concise example to test out if this causes not regression? sometimes there are regression even build passes correctly (like recent changes to filter, etcs)

@kwonoj kwonoj force-pushed the fix-observable-type branch from 0e2afc5 to e52d014 Compare December 15, 2016 00:54
@kwonoj kwonoj added the blocked label Dec 15, 2016
@kwonoj
Copy link
Member Author

kwonoj commented Dec 15, 2016

I'm marking it as blocked for review approval / and sound test plan to verify non-regression, non-breaking.

@coveralls
Copy link

coveralls commented Dec 15, 2016

Coverage Status

Coverage remained the same at 97.674% when pulling e52d014 on kwonoj:fix-observable-type into 5f93f81 on ReactiveX:master.

@benlesh
Copy link
Member

benlesh commented Dec 15, 2016

The change looks good... we'll just need to ensure it's non-breaking so we can figure out where it lands.

Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we just need to do something to ensure there are no breaking changes with this. I suspect there may be.... however, if this really is a "fix" then it's a patch, not a breaking change.

@kwonoj
Copy link
Member Author

kwonoj commented Dec 15, 2016

Agreed. Need to figure out some way to test.. /cc @david-driscoll for borrowing some idea.

@kwonoj
Copy link
Member Author

kwonoj commented Jan 3, 2017

Enabling #2202 into all current test cases will unblock this PR for most common usecase.

Copy link
Member

@david-driscoll david-driscoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -37,7 +37,7 @@ export class Observable<T> implements Subscribable<T> {
* can be `next`ed, or an `error` method can be called to raise an error, or
* `complete` can be called to notify of a successful completion.
*/
constructor(subscribe?: <R>(this: Observable<T>, subscriber: Subscriber<R>) => TeardownLogic) {
constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've suspected this could be troublesome at some point, but I'm sure I forgot about just after I saw it.

@benlesh
Copy link
Member

benlesh commented Jan 29, 2017

Okay... so this looks good, but it reminds me that we're actually leaking an implementation detail via TypeScript. We don't want to encourage our external users to use anything other than the Observer interface. Subscriber is more of an implementation thing for our library.

@benlesh benlesh merged commit 51a0bc1 into ReactiveX:master Jan 29, 2017
@kwonoj kwonoj deleted the fix-observable-type branch January 29, 2017 07:48
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked TS Issues and PRs related purely to TypeScript issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why different generics for Subscriber and Observable
4 participants