Open jtwang7 opened 2 years ago
常用 ✅ const foo = <T extends {}>(x: T): T => x;
const foo = <T extends {}>(x: T): T => x;
✅ const foo: <T>(x: T) => T = x => x;
const foo: <T>(x: T) => T = x => x;
const foo = <T,>(x: T): T => x; const foo = <T extends Record<string, unknown>>(x: T): T => x; const identity = <T,>(arg: T): T => { console.log(arg); return arg; }; const renderAuthorize = <T>(Authorized: T): ((currentAuthority: CurrentAuthorityType) => T) => ( currentAuthority: CurrentAuthorityType, ): T => { return };
常用 ✅
const foo = <T extends {}>(x: T): T => x;
✅
const foo: <T>(x: T) => T = x => x;