reactive-observables
Version:
Framework-agnostic observables and computed properties similar to Knockout and Vue, built on RxJS
13 lines (11 loc) • 415 B
text/typescript
const TrackableEntityKey = "_trackableEntity";
/**
* Decorator for classes, allows them and their properties to be tracked using a TrackedEntity
* @param constructor
*/
export function trackable(constructor: any) {
constructor.prototype[TrackableEntityKey] = true;
}
export const isTrackableEntity = (obj: any) => {
return obj !== null && typeof obj === "object" && obj[TrackableEntityKey] === true;
}