Function: Cache()
function Cache<T>(ProviderClass: Constructor<T>): (target: any, context: ClassMethodDecoratorContext) => void;
Defined in: src/data-management/cache/cache.decorator.ts:31
Type Parameters
Parameters
| Parameter |
Type |
Description |
ProviderClass |
Constructor<T> |
Clase del cache provider (debe tener @Service) |
Returns
(target: any, context: ClassMethodDecoratorContext): void;
Parameters
| Parameter |
Type |
target |
any |
context |
ClassMethodDecoratorContext |
Returns
void
Cache
- Define el provider de cache para un método
Examples
// Cache en LocalStorage
@Cache(LocalStorageCache)
@TTL(5000)
async getUserPreferences() { }
// Cache en SessionStorage
@Cache(SessionStorageCache)
@TTL(3000)
async getFilterState() { }