第196期 — 2023-01-29

在浏览器中阅读

周e信

扫描二维码关注微信公众号

Javascript

Vladimir Klepov

详解Typescript类型never🔗

用法一:定义不允许存在的属性

type VariantA = {
    a: string
    b?: never
}

type VariantB = {
    b: number
    a?: never
}

declare function fn(arg: VariantA | VariantB): void


const input = {a: 'foo', b: 123 }
fn(input) // ❌ Types of property 'a' are incompatible

never感觉有点晦涩,复杂度超过一定阈值的东西,用的人就少,别人读的也麻烦。

Zhenghao

前端

搞事情 - 建议react 官方用 Vite 替换 Create React App🔗

虽然支持的多,但是反对的声音理由更充分:

Theo Browne

nut-tree

Muhammad Ovi (Owais)

移动端

expo router即将发布🔗

支持React Navigation的整合

Evan Bacon

Andrew Lo

Stefan Aleksovski

数据库

你可能不需要 ORM🔗

用到了SQL工具AI bot

这文章老生常谈,要使用原生SQL没必要就不用ORM,结合起来用不行吗,估计作者代码都不爱定义modal他自己看得懂就行

SOME TECH BLOG

人工智能

Bryce Drennan

其他

Paul Bettner

vlucendo

扫描二维码关注微信公众号
本期阅读量