Closed fregante closed 8 years ago
That's a fair point. Feel free to update the docs to make them less confusing and to follow this convention, I'll be happy to merge your pull request.
Thank you!
No, thank you! The 'new' is technically optional so I always left it off, but there was something confusing about Hover being a function that returns an instance of a store, so I think the 'new' helps set those expectations.
This is more of a stylistic convention than an issue with the code itself.
With a few builtin exceptions, Capitalized variable names are conventionally reserved for constructors, which
Hover
technically isn't. More info: http://eslint.org/docs/rules/new-capI'd suggest to either use
Hover
as a constructor in the documentation (const state = new Hover()
) or change it to be lowercase (const state = hover()
).I noticed that it already works either way, but I found the documentation a bit confusing to read because of this 😅