我正在寻找一种优雅的方式来摆脱这次民意调查:
len(s.get_value('2015-01-01)) == 0
True
有什么想法吗?
答案 0 :(得分:1)
private pollLinkResult() {
(function poll() {
let myTimeout = setTimeout(() => {
//call the service layer to do an ajax call
//depending on the result I would like to exit the infinite poll
if(yourCondition){
clearTimeout(myTimeout);
}
}, 1000);
})();
}