UNPKG

@nestjs/common

Version:

Nest - modern, fast, powerful node.js web framework (@common)

22 lines (21 loc) 845 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CacheKey = void 0; const decorators_1 = require("../../decorators"); const cache_constants_1 = require("../cache.constants"); /** * Decorator that sets the caching key used to store/retrieve cached items for * Web sockets or Microservice based apps. * * For example: * `@CacheKey('events')` * * @param key string naming the field to be used as a cache key * * @see [Caching](https://docs.nestjs.com/techniques/caching) * * @deprecated `CacheModule` (from the `@nestjs/common` package) is deprecated and will be removed in the next major release. Please, use the `@nestjs/cache-manager` package instead * @publicApi */ const CacheKey = (key) => (0, decorators_1.SetMetadata)(cache_constants_1.CACHE_KEY_METADATA, key); exports.CacheKey = CacheKey;