vevet
Version:
Vevet is a JavaScript library for creative development that simplifies crafting rich interactions like split text animations, carousels, marquees, preloading, and more.
18 lines (14 loc) • 361 B
text/typescript
/* eslint-disable no-underscore-dangle */
export function noopIfDestroyed(
target: any,
propertyKey: string,
descriptor: PropertyDescriptor,
) {
const originalMethod = descriptor.value;
descriptor.value = function check(...args: any[]) {
if ((this as any)._isDestroyed) {
return;
}
return originalMethod.apply(this, args);
};
}