Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save omarkdev/3e66db24a2eb92b70efe7dc8149a913e to your computer and use it in GitHub Desktop.
Save omarkdev/3e66db24a2eb92b70efe7dc8149a913e to your computer and use it in GitHub Desktop.
function setApiVersion(constructor) {
return class extends constructor {
version = '0.0.1';
}
}
@setApiVersion
class Wizard {
}
console.log(new Wizard()); // class_1 { version: '0.0.1' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment