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


TypeScript og-lru-cache-factory.new函数代码示例

本文整理汇总了TypeScript中og-components/og-lru-cache-factory/models/og-lru-cache-factory.new函数的典型用法代码示例。如果您正苦于以下问题:TypeScript new函数的具体用法?TypeScript new怎么用?TypeScript new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了new函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: beforeEach

			beforeEach((): void => {
				// Populate the data with capacity + 1 items (to check that the oldest item is evicted)
				data = [...Array(capacity + 1).keys()].reverse().map((id: number): OgCacheEntry => ({id, name: `item ${id}`}));
				list = data.slice(0, capacity);

				// Create the LruCache
				ogLruCache = ogLruCacheFactory.new(capacity, data);
			});
开发者ID:scottohara,项目名称:loot,代码行数:8,代码来源:og-lru-cache-factory.ts

示例2: constructor

	public constructor(private readonly $http: angular.IHttpService, $cacheFactory: angular.ICacheFactoryService,
											private readonly $window: angular.IWindowService, ogLruCacheFactory: OgLruCacheFactory) {
		this.cache = $cacheFactory("payees");

		// Create an LRU cache and populate with the recent payee list from local storage
		this.lruCache = ogLruCacheFactory.new(LRU_CAPACITY, JSON.parse(this.$window.localStorage.getItem(this.LRU_LOCAL_STORAGE_KEY) || "[]") as OgCacheEntry[]);
		this.recent = this.lruCache.list;
	}
开发者ID:scottohara,项目名称:loot,代码行数:8,代码来源:payee.ts

示例3: it

		it("should return an LruCache", (): Chai.Assertion => ogLruCacheFactory.new(10, []).should.be.an("object"));
开发者ID:scottohara,项目名称:loot,代码行数:1,代码来源:og-lru-cache-factory.ts


注:本文中的og-components/og-lru-cache-factory/models/og-lru-cache-factory.new函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。