I have an es6 class User and a global function map() given below:
class User {
constructor(public name: string) {}
}
const map = <T, R>(project: (value: T) => R) => {}
Instead of writing the following:
map((value) => new User(value))
I want to (somehow) write something like:
map(new User)
I am not sure if this is possible or not.