現状とやりたいことは下記になります。
どのように実装すればよいのでしょうか?
現状
test() .then(function(result) { return test2(); }) .then(function(result) { if (result) { test3() .then(function(result2) { }); } else { // なにもしない } });
こんな感じにしたい
test() .then(function(result) { return test2(); }) .then(function(result) { if (result) { test3() } else { // こっちの場合は次のthenにいきたくない } }) .then(function(result) { });
test2()の内容は変更できるのですか?
回答1件
あなたの回答
tips
プレビュー