Closed k0nG closed 3 years ago
This PR breaks some of the tests. https://travis-ci.org/VadimDez/ngx-order-pipe/builds/531717911
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When using multiple sort keys with a pipe in a
*ngFor
like['sortKeyA', 'sortKeyB']
, I was seeing a flickering in my HTML view because the sort key order was constantly changing. I identified this was because of theexpression.reverse()
inmultiExpressionTransform
.array.reverse()
reverses the array in place. Which means on the next angular check cycle the array is different and then reversed again. Removing theexpression.reverse()
stops this, removing repeated sorting changing happening in components.Perhaps the
reverse
was required? But I can't see a reason for it to be run on every process cycle.References: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse]()