标签:style blog color io ar sp div on log
var Deferred = require(‘er/Deferred‘); var def = new Deferred(); def.then( function () { console.log(‘b‘) } ).then( function () { console.log(‘a‘) } ); def.then( function () { console.log(‘t‘) } );
Q:def.resolve(‘3‘); 为什么是bta; 求助 A:b完成后才执行a,而t和a并行执行,自然是bta啊
如果想bat就得defer.then(b).then(a).then(t)
为啥要分段?
Q: 因为chain想在中间给别人;
A:那就
var ba = def.then(b).then(a); ...交给别人 ba.then(t)
标签:style blog color io ar sp div on log
原文地址:http://www.cnblogs.com/cjy1993/p/4050837.html