Go 语言风格的异步处理方式
一个能被 await 的异步函数
如果成功,返回 [null, 异步函数结果],否则返回 [Error, undefined]
const [error, response] = await to(fetcher().get<Blog>("/blogs/hello-world")); Copy
const [error, response] = await to(fetcher().get<Blog>("/blogs/hello-world"));
Go 语言风格的异步处理方式