Skip to content

Instantly share code, notes, and snippets.

@szaranger
Created November 12, 2021 00:25
Show Gist options
  • Save szaranger/ffaa73353895a912c19b72df1b662ea2 to your computer and use it in GitHub Desktop.
Save szaranger/ffaa73353895a912c19b72df1b662ea2 to your computer and use it in GitHub Desktop.
blog-typescript-features-you-should-no-longer-use-82ede931243-01.js
@Freeze
class Person {}
function Freeze(constructor: Function) {
Object.freeze(constructor);
Object.freeze(constructor.prototype);
}
console.log(Object.isFrozen(Person)); // true
class Cat extends Person {} // error, cannot be extended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment