Skip to content

Conversation

@david-driscoll
Copy link
Member

…le methods

@david-driscoll
Copy link
Member Author

This pulls out the static methods as per the discussion in #870

@kwonoj
Copy link
Member

kwonoj commented Dec 10, 2015

As already discussed in original PR, I like this changes and this looks good to me. Thanks for taking time with effort @david-driscoll :)

I'll check in this once @Blesh agrees.

@david-driscoll
Copy link
Member Author

I've also gone and rebased the other branches to be based on this one, so the changes should disappear from those PRs once this is merged.

@luisgabriel
Copy link
Contributor

Super cool! 👍

@kwonoj
Copy link
Member

kwonoj commented Dec 10, 2015

It's off-topic question, is this applicable to non-static instance also?

@david-driscoll
Copy link
Member Author

Unfortunately no, because there is no way to consider the type of this currently with TypeScript.

Consider:

export function combineLatest<T2>(second: Observable<T2>): Observable<[T, T2]>;

With this function we have no idea what T is, so to define it properly we have to replace it with any to compile.

export function combineLatest<T2>(second: Observable<T2>): Observable<[any, T2]>;

And then we loose our type information. #870 works around this, copying the definitions from the operator, defined as a function, and strips out any references to T from the function declaration.

The typinggen.js basically converts:

export function combineLatest<T, T2>(second: Observable<T2>): Observable<[T, T2]>;

to:

interface Observable<T> {
    combineLatest<T2>(second: Observable<T2>): Observable<[T, T2]>;
}

So then we can then use typeof operator.xyz, as seen in #871.

@kwonoj
Copy link
Member

kwonoj commented Dec 10, 2015

Make quite sense, thanks. Think this topic need to be continued under original PR.

@kwonoj
Copy link
Member

kwonoj commented Dec 22, 2015

@david-driscoll Would you able to align commit message start with lowercase as same as other commit history?

@kwonoj
Copy link
Member

kwonoj commented Dec 22, 2015

Otherwise, change looks cool to me. I'll let this opened for a while to have any other suggestions / opinions around after commit message's aligned. Expecting to take some time due to holiday.

@benlesh
Copy link
Member

benlesh commented Jan 4, 2016

Merged with d4dd7f1. Thanks @david-driscoll!

@benlesh benlesh closed this Jan 4, 2016
@lock
Copy link

lock bot commented Jun 7, 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 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants