ralusek / bunchie Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
If bunching accumulates more than certain number of calls (eg. 65535 on Chrome) you get a Maximum call stack size exceeded (https://stackoverflow.com/questions/22747068/is-there-a-max-number-of-arguments-javascript-functions-can-accept). I worked around this by setting maxCount
to 65535 (majority of our users are on Chrome).
I'm wondering if it could be a good idea to have this cap builtin for bunchie perhaps using code like below:
function testArgumentsLength() {}
function maxStackSize() {
var argumentsLength = 0;
try {
for (var i = 1; i < 32; i++) {
argumentsLength = (argumentsLength << 1) + 1;
testArgumentsLength.apply(null, new Array(argumentsLength));
}
} catch (e) {
return argumentsLength >> 1;
}
}
At the moment errors it's not possible to pass the errors up the chain, resulting in Uncaught (in promise) Error
.
At the moment if bunchied function is called many times from a single event loop bunchie still recreates setTimeout handler. In our project this this causes a significant performance penalty. Instead bunchie could only handle debounce once per event loop, ie:
// Handle debounce.
if (!activeHandleDebounce) {
activeHandleDebounce = setTimeout(function () {
...
activeTimeout = setTimeout(function () {
return handle.apply(undefined, args);
}, deadline);
activeHandleDebounce = undefined;
}, 0);
}
I can submit pull request for this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.