本文整理汇总了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)))))