Created
January 31, 2020 09:13
-
-
Save devbyray/299739f1453e4ed4199ec8e9c341b69c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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