1 Star 0 Fork 0

Sunny / type-challenges

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.zh-CN.md 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
陈海龙 提交于 2022-07-07 10:30 . fix: typo (#12750)

Awaited 简单 #promise #built-in

by Maciej Sikora @maciejsikora

接受挑战    English 日本語 한국어

假如我们有一个 Promise 对象,这个 Promise 对象会返回一个类型。在 TS 中,我们用 Promise 中的 T 来描述这个 Promise 返回的类型。请你实现一个类型,可以获取这个类型。

例如:Promise<ExampleType>,请你返回 ExampleType 类型。

type ExampleType = Promise<string>

type Result = MyAwaited<ExampleType> // string

这个挑战来自于 @maciejsikora 的文章:original article


返回首页 分享你的解答 查看解答
1
https://gitee.com/ztes/type-challenges.git
git@gitee.com:ztes/type-challenges.git
ztes
type-challenges
type-challenges
main

搜索帮助