Becklyn / mojave

A library of commonly used JavaScript tools and helpers by Becklyn
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Don’t keep prepending elements to the same array for every additional element found #158

Closed keichinger closed 5 years ago

keichinger commented 5 years ago

Given the following example

mount(".selector", AppComponent, [someParam]);

with two matching elements, the mojave would call the AppComponent's constructor with the following args:

And it would just continue like that as we've kept prepending the elements with each additional match.

apfelbox commented 5 years ago

Can you please add a test?

keichinger commented 5 years ago

@apfelbox I've added a test that even compares the actual parameters against the expected ones.

Note that we should add more tests for mount and mountJsx.

apfelbox commented 5 years ago

Thanks 🎈