@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
22 lines (21 loc) • 1.15 kB
TypeScript
/**
* Implements lazy initialization for getter or memoization of a function call similar to pure {@link: Pipe}.
* Replaces getter with its calculated value upon first call or keeps track of last call arguments and returned
* value for function, skipping calculation when arguments are strictly the same.
*
* @throws error if used not on getter or function
*
* CAUTION: they must be pure.
*/
export declare function tuiPure<T>(target: object, propertyKey: string, { get, enumerable, value }: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
/**
* Implements lazy initialization for getter or memoization of a function call similar to pure {@link: Pipe}.
* Replaces getter with its calculated value upon first call or keeps track of last call arguments and returned
* value for function, skipping calculation when arguments are strictly the same.
*
* CAUTION: they must be pure.
*/
export declare function tuiPure<A extends unknown[], R>(target: (...args: A) => R, context: ClassGetterDecoratorContext | ClassMethodDecoratorContext): (...args: A) => R;
export declare class TuiPureException extends Error {
constructor();
}