property-watch-decorator
Version:
A decorator for watching property change
9 lines (8 loc) • 365 B
TypeScript
export interface SimpleChange<T> {
firstChange: boolean;
previousValue: T;
currentValue: T;
isFirstChange: () => boolean;
}
export declare type CallBackFunction<T> = (value: T, change?: SimpleChange<T>) => void;
export declare function OnChange<T = any>(callback: CallBackFunction<T> | string): (target: any, key: string | number | symbol) => void;