<i>We use dependency injection to match State names to parameters of Behavior functions—the State numberOfStates gets injected into any Behavior function that lists is as a parameter, like function(numberOfStates).</i><p>We need to have a talk. First, this isn't dependency injection - you're passing in data. These "Behavior" functions may <i>depend</i> on the data, but that doesn't make this a <i>dependency</i>.<p>Oh, I can understand how you're confused. You see Angular doing it and reverse-engineered the term. But notice how in Angular it is used to pass services into controllers, services that the controller has a <i>dependency</i> on.<p>Also, notice how this "feature" is broken in production. Any website worth its salt will minify the assets, which changes function parameter names. You did notice that, right, that your clever little hack works great in your development environment but totally breaks when you minify your code? You are testing things minified, right?<p>Why would you spend any time at all working on a feature that is fundamentally broken in production? Kill your darlings.