Pot.Deferred.prototype.wait

{Pot.Deferred} Pot.Deferred.prototype.wait ({Number} seconds [, {*} value])

Pot.js と PotLite.js で利用可能。

秒単位で待機します。

Deferred チェイン上で、秒単位で待機します。
引数 seconds 秒たつまで次のチェインは実行されません。

実行時の Pot.Deferred インスタンスが返ります。

Pot.Deferred.begin(function() {
    return 1;
}).wait(1).then(function(res) { // 1 秒待つ
    debug(res);
    return res + 1;
}).wait(1.5).then(function(res) { // 1.5 秒待つ
    debug(res); // 2
    return res + 1;
}).wait(0).then(function(res) { // 瞬間的な間隔をおく
    debug(res); // 3
});