opkmy.blogg.se

Findindex js
Findindex js









findindex js

Why are all array functions multi-fold affected with each passing level? And why specially find and findIndex are affected much worse? However, we are not supposed to implement our own work-around and so considering this as bug in LWC. I found the solution by using JSON.parse and JSON.stringify or else if its only single level array objects then by using shallow copy by Spread syntax. Click on test buttons to check performance in parent, child and grand-child.When we use any array function, the performance is excellent when used in parent but is worst and adversely affected when in grand-child and worst of all the functions affected are find and findIndexĬonsider the example in this playground - This will work fine in playground as locker service is disabled but when you test in any dev org/sandbox, you will notice the difference

findindex js

This is how we should communicate down the hierarchy according to LWC best practices. Pass an Array from container to all the way down to grand-child.











Findindex js