Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

为这段promise代码加注解

$
0
0

求个大神能为这个代码加下注解,尽量详细些

function chainAnimationsPromise(elem, animations) { let ret = null; let p = currentPromise; for(const anim of animations) { p = p.then(function(val) { ret = val; return anim(elem); }) } return p.catch(function(e) { /* ignore and keep going */ }).then(function() { return ret; }); }


Viewing all articles
Browse latest Browse all 14821

Trending Articles