本文整理匯總了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))
})));
示例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.
});
});
}
示例3: fsCopy
.then((files) => Promise.all(files.map((file) => fsCopy(path.join('dist', file), path.join('.', file)))))