glittershark / reactable

Fast, flexible, and simple data tables in React
glittershark.github.io/reactable
MIT License
1.51k stars 222 forks source link

sortFunction given a and b as is, filterFunction is given string #378

Open yoiang opened 7 years ago

yoiang commented 7 years ago

Hey, thanks so much for the work on this project, it's a charm.

I have one question regarding implementation:

If one provides a column a sortFunction that function is sent a and b (left and right) exactly how the values have been given (https://github.com/glittershark/reactable/blob/8e386acbe60387dbdfc2f5d75c9cf0029929f97b/src/reactable/table.jsx#L325-L329)

On the other hand if one provides a column a filterFunction that function is sent contents a string, always (https://github.com/glittershark/reactable/blob/8e386acbe60387dbdfc2f5d75c9cf0029929f97b/src/reactable/table.jsx#L280)

Is there a reason for this difference? It would be great to preserve contents' type to match sortFunction, that way you have more of the original information to test your filter function on.