-
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(ErrorObservable): clarify an error type E
for ErrorObservable.
#2071
refactor(ErrorObservable): clarify an error type E
for ErrorObservable.
#2071
Conversation
7ea0a2c
to
3a5770e
Compare
updated the commit message. |
@saneyuki wouldn't this break type inference such as if in our selector, we're depending on function selector(x: number) {
if (x % 2 === 0) {
return Observable.throw<number>('nope nope nope');
}
return Observable.of<number>(1);
} |
I think @mattpodwysocki is right here. @david-driscoll or @kwonoj can you confirm? |
|
24b2bc0
to
d188b9b
Compare
So this seems bit tricky. First, I think generic of error observable itself is redundant, cause it does not being used to infer type of error. For example, in current interface Since ErrorObservable itself does not have generic type and force set base observable type to any. But also it is questionable if it's right to give type to ErrorObservable itself, since all of error being emit in Observable is currently Waiting @david-driscoll 's input as well. |
I think this should be: @saneyuki, if you want to make that change in this PR that would be cool. Otherwise, I don't think we'll merge this PR, but rather make that change in another PR. :PR: |
Okay. I'll change to it. BTW, I think it would be better to use type parameter |
d188b9b
to
b5fb259
Compare
E
for ErrorObservable.
I have updated this pull request. Your comment is like this, isn't it? |
b5fb259
to
47b526f
Compare
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. |
Description:
ErrorObservable.create()
(Obserbable.throw()
)takes a new type parameter
E
that express a error type instead on oldone's
T
.ErrorObservable<E>
.Observable<any>
, it's not changed fromold one.
E
now.