We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function repeat (func, times, wait) { return function(){ var _arguments=arguments; var timer = setInterval(function(){ func.apply(null,Array.prototype.slice.call(_arguments,0)); --times || clearInterval(timer); }, wait); } } var repeatedFun = repeat(console.log, 10, 100); repeatedFun("hellworld"); function repeat (func, times, wait) { return function(){ var _arguments=arguments; var that=this; this.timer=function(_t){ _t&&clearTimeout(_t); var t=setTimeout(function(){ func.apply(null,Array.prototype.slice.call(_arguments,0)); --times && that.timer(t); },wait); } this.timer(); } }
有一个url数组 var urls = ['/a', '/b', '/c',...] 要求依次请求这几个url, 要求是 第一个请求完了才发第二个请求,第二个完了才发第三个请求 如此依次。 var url = []; var count = 0; function getData(url){ if(count>=url.length) return; count++; Promise.resolve(jQuery.get(url[0])).then(function(data){ console.log(data); getData(url.slice(1)); }); }
https://juejin.im/post/5ac9d8286fb9a028c97a5420#heading-10
mini - https://blog.csdn.net/liuliuliu_666/article/details/78364791
The text was updated successfully, but these errors were encountered:
No branches or pull requests
repeat
接口依次调用
webpack打包原理
https://juejin.im/post/5ac9d8286fb9a028c97a5420#heading-10
mini - https://blog.csdn.net/liuliuliu_666/article/details/78364791
The text was updated successfully, but these errors were encountered: