Skip to content

Instantly share code, notes, and snippets.

/**
* Property decorator to log when property values changes.
* @param {any} target The constructor function of a class for a static member or the prototype of the class for an instance member.
* @param {string} key The name of the member.
*/
function logProperty(target: any, key: string) {
// Property value.
let _val = this[key];
// Property getter.