短评 · ·

X 归档 2022-12-13

2 条动态 · 图 1 · 视频 0
#AngularTip for the day. Make a super simple directive and a little DI to create an easy-to-use resize in #Angular. Live demo:
https://stackblitz.com/edit/resizer-directive

Coming to Taiga UI near you 😎
今日 #AngularTip。写一个超级简单的指令,加上一点点 DI,就能在 #Angular 中实现一个好用的 resize。在线演示:

即将来到你身边的 Taiga UI 😎
@Waterplea 的配图 1/1
const modifiers for type parameters are coming to TS 5.0, I had a feeling that this might happen soon

loving, loving it ❤️

declare function bar<const T>(obj: T): T;

bar([1, 'foo']) // readonly [1, 'foo'], and not (string | number)[]

https://github.com/microsoft/TypeScript/pull/51865
类型参数的 const 修饰符要登陆 TS 5.0 了,我之前就预感这事快来了

爱了,太爱了 ❤️

declare function bar<const T>(obj: T): T;

bar([1, 'foo']) // 得到 readonly [1, 'foo'],而不是 (string | number)[]

https://github.com/microsoft/TypeScript/pull/51865