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

Error Observable has incorrect signature #2395

Closed
raybooysen opened this issue Feb 20, 2017 · 3 comments · Fixed by #2397
Closed

Error Observable has incorrect signature #2395

raybooysen opened this issue Feb 20, 2017 · 3 comments · Fixed by #2397
Labels
TS Issues and PRs related purely to TypeScript issues

Comments

@raybooysen
Copy link

In master currently, ErrorObservable has the following code:

  static create<T>(error: T, scheduler?: IScheduler): ErrorObservable<T> {
    return new ErrorObservable(error, scheduler);
  }

  static dispatch(arg: DispatchArg) {
    const { error, subscriber } = arg;
    subscriber.error(error);
  }

  constructor(public error: T, private scheduler?: IScheduler) {
    super();
  }

I don't think any of the error parameters should be of type T. They should be of type Error or most likely any. The documentation even says this:
* @param {any} error The particular Error to pass to the error notification.

@kwonoj kwonoj added the TS Issues and PRs related purely to TypeScript issues label Feb 20, 2017
@kwonoj
Copy link
Member

kwonoj commented Feb 20, 2017

I think this signature comes while overriding base classes static creation method. Error itself doesn't have type constraint so even generating ErrorObservable with given type it is not being used actually, so probably it'd better to remove out for clarity.

@raybooysen
Copy link
Author

Thanks @kwonoj

@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
TS Issues and PRs related purely to TypeScript issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants