当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ImmutableMap.of方法代码示例

本文整理汇总了TypeScript中external/gs_tools/src/immutable.ImmutableMap.of方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ImmutableMap.of方法的具体用法?TypeScript ImmutableMap.of怎么用?TypeScript ImmutableMap.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在external/gs_tools/src/immutable.ImmutableMap的用法示例。


在下文中一共展示了ImmutableMap.of方法的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.of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。