Commit a67f34e
committed
Addresses debouncing for resize events at 50ms
This directly addresses #2, where debounce is needed for resize. Without
a debounce, `this.handleResize()` is called hundreds of times during a
resize operation, potentially causing multiple prop changes, and
multiple renders.
The debounce used is based on underscore and jQuery's debounce, without
the `immediate` flag. Debounce was set to 50ms, which is a reasonable
default. I don't personally think it needs to be configurable, it just
needed to be debounced.1 parent 8ff3745 commit a67f34e
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
7 | 21 | | |
8 | 22 | | |
9 | 23 | | |
| |||
45 | 59 | | |
46 | 60 | | |
47 | 61 | | |
48 | | - | |
| 62 | + | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| |||
0 commit comments