Creates a custom class or method decorator that stores metadata readable by the DecoratorPlugin and custom decorator handlers.
At registration, for each registered DecoratorHandler whose name matches, the handler is invoked with (metadata, target, propertyKey?).
DecoratorHandler
(metadata, target, propertyKey?)
Unique decorator name (convention: plugin-name:decorator)
plugin-name:decorator
Arbitrary metadata payload
A class or method decorator
export const Cacheable = (ttl: number) => createDecorator('cache:cacheable', { ttl }); Copy
export const Cacheable = (ttl: number) => createDecorator('cache:cacheable', { ttl });
0.1.0
Creates a custom class or method decorator that stores metadata readable by the DecoratorPlugin and custom decorator handlers.
At registration, for each registered
DecoratorHandlerwhose name matches, the handler is invoked with(metadata, target, propertyKey?).