Skip to content

Instantly share code, notes, and snippets.

@devbyray
Created January 31, 2020 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devbyray/299739f1453e4ed4199ec8e9c341b69c to your computer and use it in GitHub Desktop.
Save devbyray/299739f1453e4ed4199ec8e9c341b69c to your computer and use it in GitHub Desktop.
function hobbitDec<T extends { new(...args: any[]): {} }>(constructor: T) {
const hobbit = new Hobbit()
const { width, height, weight, armour, type} = hobbit
return class extends constructor {
width = width
height = height
weight = weight
armour = armour
type = type
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment