jesseskinner / hover

A very lightweight data store with action reducers and state change listeners.
MIT License
98 stars 7 forks source link

Only constructor functions should be capitalized #23

Closed fregante closed 8 years ago

fregante commented 8 years ago

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-cap

I'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 😅

jesseskinner commented 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.

fregante commented 8 years ago

Thank you!

jesseskinner commented 8 years ago

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.