vguillou / poly-filter

A fast and customizable solution for client side filtering of arrays, made with and for Polymer.
https://vguillou.github.io/webcomponents/poly-filter
MIT License
14 stars 3 forks source link

filter-by attribute accept separate string by commas #3

Closed joserochadocarmo closed 7 years ago

joserochadocarmo commented 7 years ago

Hi, this component help me a lot, it is fast and easy, thanks! The filter-by accept array and string, but if you choose array, you have to declare the array in polymer properties, ok, this is not a problem, or you can also, separate string by commas.

<poly-filter array-to-filter="[[data]]" filter="[[searchTerm]]" filtered-array="{{dataFilter}}" filter-by="description,createdTime,updatedAt">
 </poly-filter>
vguillou commented 7 years ago

Hi, thanks a lot for contributing! 👍

I see what you want to achieve here. However, i think it would be much more optimal to test and split the String here. It would avoid testing for the type every single time the '_concat' function is called.

Could you modify your pull-request? Also it would be necessary to reflect the changes in the documentation of the 'filterBy' property, as well as writing at least one unit test. Would you be up for it ? 😃

joserochadocarmo commented 7 years ago

Hi, you are right, I will do this! Thanks for the tips.

vguillou commented 7 years ago

This improvement suggested here as been implemented in 7c0458c1e369fcf36f7fb3f535828ce1f86abf41. Thanks again @joserochadocarmo for the suggestion and PR ! 👍