MakeSelectable has a name with a capital letter. Typically, functions with a capital letter should be called with new, so I expect to be able to call the function in that manner. But the function is defined as an arrow function, and arrow functions cannot be called with new.
Even if it makes no difference for a particular function to be called with or without new, our linters might warn us against calling capitalized functions without new. Some linters allow whitelisting "safe names," but it's nicer not to have to manage that. And, ignoring arrow functions, it is always safe to call a function with new, whereas it is not always safe to call a function without new. Therefore, it's better for us to always have the option to call functions with new, even redundantly.
For the sake of backwards compatibility, it would probably be better to keep the capitalized name, and make the function new-able (i.e., create it with function, rather than () => {}). Otherwise, it should be renamed to makeSelectable, so we have a clearer expectation about its calling convention.
MakeSelectablehas a name with a capital letter. Typically, functions with a capital letter should be called withnew, so I expect to be able to call the function in that manner. But the function is defined as an arrow function, and arrow functions cannot be called withnew.Even if it makes no difference for a particular function to be called with or without
new, our linters might warn us against calling capitalized functions withoutnew. Some linters allow whitelisting "safe names," but it's nicer not to have to manage that. And, ignoring arrow functions, it is always safe to call a function withnew, whereas it is not always safe to call a function withoutnew. Therefore, it's better for us to always have the option to call functions withnew, even redundantly.For the sake of backwards compatibility, it would probably be better to keep the capitalized name, and make the function new-able (i.e., create it with
function, rather than() => {}). Otherwise, it should be renamed tomakeSelectable, so we have a clearer expectation about its calling convention.