iframe-resizer icon indicating copy to clipboard operation
iframe-resizer copied to clipboard

add a debounceInterval parameter

Open albanm opened this issue 9 years ago • 1 comments

Hello,

To reduce the performance impact of iframe-resizer could you add a parameter to increase the interval between analysis of the mutations ?

What I have in mind would simply be to put a var instead of 16 here: https://github.com/davidjbradshaw/iframe-resizer/blob/master/src/iframeResizer.js#L858

I use lowestElement and I think 32 ms would be good enough for use cases where performance is an issue.

Great library by the way :)

albanm avatar Jan 25 '16 10:01 albanm

Have a look how this code works in the iFrame. Times the calculations and slows the interval if it takes to long. When I next have some spare time I'll add this to the list of things to look at. Or feel free to submit a PR along those lines.

davidjbradshaw avatar Feb 08 '16 21:02 davidjbradshaw