本文整理汇总了TypeScript中external/gs_tools/src/immutable.ImmutableMap类的典型用法代码示例。如果您正苦于以下问题:TypeScript ImmutableMap类的具体用法?TypeScript ImmutableMap怎么用?TypeScript ImmutableMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ImmutableMap类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1:
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>];
}));
}
开发者ID:garysoed,项目名称:gs-ui,代码行数:8,代码来源:route-graph.ts
示例2: addBundle
/**
* @param files The bundle of files to add.
* @return Object containing the bundle ID and a function to delete the bundle.
*/
addBundle(files: File[]): {deleteFn: () => void, id: string} {
const id = this.idGenerator_.generate([...ImmutableMap.of(this.bundles_).keys()]);
this.bundles_.set(id, files);
return {
deleteFn: function(this: FileService): void {
this.bundles_.delete(id);
}.bind(this),
id: id,
};
}
开发者ID:garysoed,项目名称:gs-ui,代码行数:14,代码来源:file-service.ts
示例3: FakeRouteFactory
static create<T>(factoryMap: Iterable<[string, T]>): FakeRouteFactoryService<T> {
const factories = ImmutableMap.of([...factoryMap])
.map((type: T) => new FakeRouteFactory(type));
const service = new FakeRouteFactoryService(factories.values());
for (const [key] of factoryMap) {
service[key] = () => factories.get(key);
}
return service;
}
开发者ID:garysoed,项目名称:gs-ui,代码行数:11,代码来源:fake-route-factory-service.ts
示例4: it
it(`should return null if none of the route factory maps produces any routes`, () => {
const path = 'path';
const mockFactory = jasmine.createSpyObj('Factory', ['createFromPath']);
mockFactory.createFromPath.and.returnValue(null);
const map = ImmutableMap.of([
[Mocks.object('view'), mockFactory],
]);
assert(providesMatch(path, map)).to.beNull();
assert(mockFactory.createFromPath).to.haveBeenCalledWith(path);
});
开发者ID:garysoed,项目名称:gs-ui,代码行数:12,代码来源:route-graph_test.ts
示例5: it
it('should return empty object', () => {
assert(factory['getRelativeMatchParams_'](ImmutableMap.of<string, string>([]))).to.equal({});
});
开发者ID:garysoed,项目名称:gs-ui,代码行数:3,代码来源:simple-route-factory_test.ts
注:本文中的external/gs_tools/src/immutable.ImmutableMap类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论