Promiseã使ã£ãã«ã¼ãå¦çã®ãµã³ãã«ã¯ããã¤ããããã©ã Promiseã®çµæã使ã£ã¦whileã£ã½ãå¦çããããæ¹ããã¾ããªãã£ãã®ã§ã¡ã¢ã å¤ãªã¨ããããã£ã¨ããããæ¹ãããã°ã³ã¡ã³ããã ãã function loopUnit() { return new Promise(resolve => { /* ã«ã¼ãå¦çæ¬ä½ */ resolve(result) }) } function looper() { return new Promise(resolve => { // æ°¸ä¹ ã«ã¼ãã«ãªããªãããã«éçæ¡ä»¶ãå ¥ãã (optional) if ( /* éçæ¡ä»¶ */) { resolve() return } // ã«ã¼ãå¦ç loopUnit().then(result => { if ( /* whileæ¡ä»¶ */ ) { looper().then(() => res
{{#tags}}- {{label}}
{{/tags}}