-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add generic types to RxObservableQuery #30
Conversation
@@ -19,7 +19,7 @@ export class RxObservableQuery<T> extends Observable<T> { | |||
} | |||
} | |||
|
|||
public lift<T, R>(operator: Operator<T, R>): Observable<R> { | |||
public lift<R>(operator: Operator<ApolloQueryResult<T>, ApolloQueryResult<R>>): Observable<ApolloQueryResult<R>> { |
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.
I think this is wrong - has broken stuff for me.
Should be something like...
public lift<R>(operator: Operator<ApolloQueryResult<T>, R>): Observable<R> {
Otherwise map
etc doesn't work.
I'm currently getting typescript compile errors because of the type mismatch when i use .map
rxObs.map(result => result.data) // invalid type, as T is not compatible with ApolloQueryResult<T>
See also:
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.
@armstrjare Could you post a PR?
sure
On Tue, 7 Feb 2017 at 13:40 Kamil Kisiela ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/RxObservableQuery.ts
<#30>:
> @@ -19,7 +19,7 @@ export class RxObservableQuery<T> extends Observable<T> {
}
}
- public lift<T, R>(operator: Operator<T, R>): Observable<R> {
+ public lift<R>(operator: Operator<ApolloQueryResult<T>, ApolloQueryResult<R>>): Observable<ApolloQueryResult<R>> {
@armstrjare <https://github.com/armstrjare> Could you post a PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAF3vA5iIbRxy24NP8Ug2WS887XC5cbWks5raHRbgaJpZM4L3OVG>
.
--
Jared Armstrong
Founder & CEO
MinuteDock - *Time & billing software for small business*
(Web) http://minutedock.com
(Mobile) +44 7482 472699
(Skype) jared.armstrong
|
No description provided.