本文整理汇总了TypeScript中external/gs_tools/src/immutable.ImmutableSet类的典型用法代码示例。如果您正苦于以下问题:TypeScript ImmutableSet类的具体用法?TypeScript ImmutableSet怎么用?TypeScript ImmutableSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImmutableSet类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: bootstrap
/**
* Bootstraps the app.
*
* @param theme The theme to apply to the app.
*/
bootstrap(theme: Theme = DEFAULT_THEME_, customElements: gs.ICtor<BaseDisposable>[] = []): void {
const ctors = ImmutableSet.of(DEFAULT_ELEMENTS_).addAll(ImmutableSet.of(customElements));
for (const ctor of ctors) {
this.registrar_.register(ctor);
}
this.themeService_.install(theme);
}
示例2:
export function providesRouteFactoryMap<T>(
routeFactories: Iterable<RouteFactory<T>>): RouteFactoryMap<T> {
return ImmutableMap.of(
ImmutableSet.of([...routeFactories])
.mapItem((factory: RouteFactory<T>) => {
return [factory.getType(), factory] as [T, RouteFactory<T>];
}));
}
示例3: processBundle
/**
* @param bundleId ID of the bundle to process.
* @return Promise that will be resolved with a map of File to its content, or null if the
* bundle ID does not exist.
*/
async processBundle(bundleId: string): Promise<Map<File, string> | null> {
const files = this.getBundle(bundleId);
if (files === null) {
return Promise.resolve(null);
}
const promises = ImmutableSet
.of(files)
.mapItem((file: File) => {
return Promise.all([file, this.processFile_(file)]);
});
return new Map(await Promise.all(promises));
}