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


TypeScript p-all類代碼示例

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


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

示例1: buildDemos

function buildDemos(filePaths: string[]) {
  const functions = filePaths.map(filePath => () => {
    return buildDemo(filePath);
  });
  let concurrentNumber = 2;
  if (argv.concurrency) {
    concurrentNumber = argv.concurrency;
  }
  return pAll(functions, {concurrency: concurrentNumber});
}
開發者ID:Artfloriani,項目名稱:ionic,代碼行數:10,代碼來源:demos.prod.ts

示例2: buildTests

function buildTests(filePaths: string[]) {
  const functions = filePaths.map(filePath => () => {
    return buildTest(filePath);
  });

  // Run 2 tests at a time unless the `concurrency` arg is passed
  let concurrentNumber = 2;
  if (argv.concurrency) {
    concurrentNumber = argv.concurrency;
  }
  return pAll(functions, {concurrency: concurrentNumber}).then(() => {
    // copy over all of the protractor tests to the correct location now
    return copyProtractorTestContent(filePaths);
  });
}
開發者ID:Artfloriani,項目名稱:ionic,代碼行數:15,代碼來源:e2e.prod.ts

示例3: buildDemos

function buildDemos(filePaths: string[]) {
  var batches = chunkArrayInGroups(filePaths, argv.batches || 1);
  var batch = argv.batch || 0;
  if(batch >= batches.length) {
    throw new Error(`Batch number higher than total number of batches.`);
  }

  console.log(`Compiling ${batches[batch].length} of ${filePaths.length} Demos ...`);

  const functions = batches[batch].map(filePath => () => {
    return buildDemo(filePath);
  });
  let concurrentNumber = 2;
  if (argv.concurrency) {
    concurrentNumber = argv.concurrency;
  }
  return pAll(functions, {concurrency: concurrentNumber});
}
開發者ID:aggarwalankush,項目名稱:ionic,代碼行數:18,代碼來源:demos.prod.ts


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