當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript promise.all函數代碼示例

本文整理匯總了TypeScript中ember-cli/lib/ext/promise.all函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript all函數的具體用法?TypeScript all怎麽用?TypeScript all使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了all函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: fsCopy

 .then((files) => Promise.all(files.map((file) => {
   if (file === '.gitignore'){
     // don't overwrite the .gitignore file
     return Promise.resolve();
   }
   return fsCopy(path.join('dist', file), path.join('.', file))
 })));
開發者ID:DevVersion,項目名稱:angular-cli,代碼行數:7,代碼來源:github-pages-deploy.ts

示例2: function

  run: function(options) {
    var builder = new Builder({
      ui: this.ui,
      outputPath: options.outputPath,
      project: this.project,
      environment: options.environment
    });

    var watcher = new Watcher({
      ui: this.ui,
      builder: builder,
      analytics: this.analytics,
      options: options
    });

    var serverRoot = './server';
    var serverWatcher = null;
    if (existsSync(serverRoot)) {
      serverWatcher = new ServerWatcher({
        ui: this.ui,
        analytics: this.analytics,
        watchedDir: path.resolve(serverRoot)
      });
    }

    var expressServer = new ExpressServer({
      ui: this.ui,
      project: this.project,
      watcher: watcher,
      serverRoot: serverRoot,
      serverWatcher: serverWatcher
    });

    var liveReloadServer = new LiveReloadServer({
      ui: this.ui,
      analytics: this.analytics,
      project: this.project,
      watcher: watcher,
      expressServer: expressServer
    });

    return Promise.all([
      liveReloadServer.start(options),
      expressServer.start(options)
    ]).then(function() {
      return new Promise(function() {
        // hang until the user exits.
      });
    });
  }
開發者ID:TheLarkInn,項目名稱:angular-cli,代碼行數:50,代碼來源:serve.ts

示例3: fsCopy

 .then((files) => Promise.all(files.map((file) => fsCopy(path.join('dist', file), path.join('.', file)))))
開發者ID:DrMabuse23,項目名稱:angular-cli,代碼行數:1,代碼來源:github-pages-deploy.ts


注:本文中的ember-cli/lib/ext/promise.all函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。