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

lowercase contructor names with Rxjs #631

Closed
piq9117 opened this issue Sep 17, 2016 · 3 comments

Comments

@piq9117
Copy link

commented Sep 17, 2016

const myArrayWithDuplicatesInARow = new Rx.Observable
  .fromArray([1, 1, 2, 2, 3, 1, 2, 3])

This gives me a warning

A constructor name should not start with a lowercase letter

Rxjs has its constructors setup this way. How do I make it work with standardjs?

P.S
I ❤️❤️❤️ standardjs! It has saved me from a lot of hassle.

@feross

This comment has been minimized.

Copy link
Member

commented Sep 17, 2016

It looks like Rx.Observable.fromArray() is meant to be used as a factory method. That is, without the new keyword.

Source: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/fromarray.md#example

If you remove new does the code still work?

@feross feross added the question label Sep 17, 2016

@piq9117

This comment has been minimized.

Copy link
Author

commented Sep 17, 2016

Cool! that totally worked! Thank you @feross!

@piq9117 piq9117 closed this Sep 17, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Sep 17, 2016

Cheers :neckbeard:

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.