rreusser / controls-state

⚙️ An object for managing state
https://observablehq.com/@rreusser/control-panel-2-prototype-test
21 stars 2 forks source link

Change the umd name to State to mathch the examples when not using a bundle #2

Closed marcofugaro closed 5 years ago

marcofugaro commented 5 years ago

WIth the current version, when you use controls-state from the browser via a script tag (for example in a codepen using https://unpkg.com/controls-state@1.1.1/dist/controls-state.min.js) you have to write ControlsState instead of State like it is in the examples.

This PR fixes it by changing the UMD name to State

rreusser commented 5 years ago

Agreed they should match. Do you think maybe the examples should be modified to match the UMD name rather than the other way around? My only concern is just that State might be generic enough for annoying ambiguity or name collisions.

marcofugaro commented 5 years ago

I honestly think ControlsState is a way too long name to use and prefer just the simple State 😅

True, State might me more generic, however I think it's not really common for libraries to expose a State to the window, it might be the user that has a State variable, but I think he would be to understand the name collisions, also we're talking about only of the browser environment, most of the developers use bundlers.

rreusser commented 5 years ago

Sorry I've been slow on this, @marcofugaro! I think you're right about prioritizing convenience for the standalone version since most developers use bundlers and can choose the name anyway 👍

marcofugaro commented 5 years ago

Nice, should we merge this? 😅