Created
February 23, 2018 09:18
-
-
Save adrianfaciu/e811c2d84ba8791bba0e06b7f0b0638f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Point { | |
constructor(public point: number) {} | |
} | |
function creator<T, G>(type: { new (args: G): T }) { | |
return (args: G) => new type(args); | |
} | |
[1, 2, 3].map(creator(Point)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment