3 ms·
Not sure why I was downvoted, I think it's a valid point. To prove it, here's the functionality of your library in ES5 with a naive throttle function: https://g
by nathancahill 10y ago
Not sure why I was downvoted, I think it's a valid point. To prove it, here's the functionality of your library in ES5 with a naive throttle function: https://gist.github.com/nathancahill/f7ea239306737f2075a94de33881dc2e https://gist.github.com/nathancahill/f7ea239306737f2075a94de...
Minified (1.49kb) and gzipped (677b).
Whether lodash functions should be used instead of naive functions is up for debate. My opinion is if the lodash functions are 5x the size of the entire library, it's probably best to not include it, or to include it as a build option (if the user's project already includes lodash for example).
- jdd 10y agoNo worries, lodash/debounce can be reduced further with babel+webpack plugins. Assuming the current setup of babel+webpack the difference between your naive version is just ~0.5 kB.
- nathancahill 10y agoWhich still doubles the size of the library: ~0.6kb to ~1.1kb. So while it's just half a kilobyte, do that over and over, with nested dependencies and it really adds up.