@rx-angular/template
Version:
**Fully** Reactive Component Template Rendering in Angular. @rx-angular/template aims to be a reflection of Angular's built in renderings just reactive.
54 lines (53 loc) • 1.99 kB
TypeScript
import { OnDestroy, ViewRef } from '@angular/core';
import * as i0 from "@angular/core";
/**
* A service that caches templates and placeholders to optimize view rendering.
* It makes sure that all cached resources are cleared when the service is destroyed.
*
* @developerPreview
*/
export declare class VirtualViewCache implements OnDestroy {
#private;
/**
* Stores a placeholder view in the cache. When the cache reaches its limit,
* the oldest entry is removed.
*
* @param key - The key used to identify the placeholder in the cache.
* @param view - The ViewRef of the placeholder to cache.
*/
storePlaceholder(key: unknown, view: ViewRef): void;
/**
* Retrieves a cached placeholder view using the specified key.
*
* @param key - The key of the placeholder to retrieve.
* @returns The ViewRef of the cached placeholder, or undefined if not found.
*/
getPlaceholder(key: unknown): ViewRef;
/**
* Stores a content view in the cache. When the cache reaches its limit,
* the oldest entry is removed.
*
* @param key - The key used to identify the content in the cache.
* @param view - The ViewRef of the content to cache.
*/
storeContent(key: unknown, view: ViewRef): void;
/**
* Retrieves a cached content view using the specified key.
*
* @param key - The key of the content to retrieve.
* @returns The ViewRef of the cached content, or undefined if not found.
*/
getContent(key: unknown): ViewRef;
/**
* Clears both content and placeholder caches for a given key.
*
* @param key - The key of the content and placeholder to remove.
*/
clear(key: unknown): void;
/**
* Clears all cached resources when the service is destroyed.
*/
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualViewCache, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<VirtualViewCache>;
}