TypeScript — Discriminated Unions
Key concepts
A common literal field lets the compiler narrow types automatically inside switch/case.discriminated union
Combine with exhaustive `never` checks to catch missing branches at build time.
听起来很熟悉?
阻碍学习者进步的常见问题。
反复查的语法
你学了新框架和语言,但发现自己在反复搜索同样的东西。
没时间深入学习
在交付功能和修bug之间,好好学习新工具总是被搁置。
技术变化太快
等你掌握一个框架,又出了三个新的——周而复始。
如何运作
从原始笔记到长期记忆,只需三步。
捕获
粘贴文档、录制技术演讲或拍摄代码片段。
生成
AI创建涵盖语法、API和概念的记忆卡片。
记忆
间隔重复建立永久知识,而非短暂熟悉。
为你的学习方式而设计
了解Repeatica如何将你的学习工作流变成记忆系统。
AI记忆卡片
粘贴文档或教程,几秒内获得实用记忆卡片。AI提取值得记忆的语法、方法和概念模式。
- 从任何技术内容自动生成
- 涵盖语法、API和最佳实践
- 完全可编辑——添加代码示例
技术演讲录音
录制最长2小时的技术会议、演讲或结对编程。获得转录并生成学习材料。
- 录制最长2小时音频
- 粘贴任何技术演讲视频链接
- AI自动转录
...so the key thing about discriminated union is the limited capacity, which is why we structure the lesson around chunked instruction...
间隔重复
在科学最优间隔复习。SM-2算法将知识从短期记忆转移到长期记忆。
- SM-2算法根据你的记忆保持率自适应
- 每日提醒配合工作节奏
- 追踪各技术栈的掌握程度
How do you make a switch over a discriminated union exhaustive?
Add a default branch that assigns the value to a `never`-typed variable — TS errors on missing cases.
还有更多
高效学习所需的一切。
Markdown和代码
支持代码块、语法高亮和格式排版的富文本笔记。
随时随地学习
iOS、Android、网页和桌面——编译时或PR间隙随时复习。
智能摘要
AI生成的摘要,面试或项目前快速复习概念。