本文整理汇总了TypeScript中ember-metal.Cache类的典型用法代码示例。如果您正苦于以下问题:TypeScript Cache类的具体用法?TypeScript Cache怎么用?TypeScript Cache使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cache类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getComponentDefinition
getComponentDefinition(name: string, { owner, moduleName }: any): ComponentDefinition<Opaque> {
let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name);
let source = moduleName && `template:${moduleName}`;
let definition = this._definitionCache.get({ name, source, owner });
finalizer();
// TODO the glimmer-vm wants this to always have a def
// but internally we need it to sometimes be undefined
return definition!;
}
示例2: getCompiledBlock
// a Compiler can wrap the template so it needs its own cache
getCompiledBlock(Compiler: any, template: OwnedTemplate) {
let compilerCache = this._compilerCache.get(Compiler);
return compilerCache.get(template);
}
示例3: getTemplate
// normally templates should be exported at the proper module name
// and cached in the container, but this cache supports templates
// that have been set directly on the component's layout property
getTemplate(Template: WrappedTemplateFactory, owner: Container): OwnedTemplate {
return this._templateCache.get({ Template, owner });
}