Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit88d0566

Browse files
authored
Drop generic Unwrap in favor of built-in Awaited (#18)
Awaited came in TS 4.5, after the first implementation of github-blog,so I needed to create Unwrap
1 parent0c4a594 commit88d0566

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

‎src/methods/getComments.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{gql}from"code-tag";
2-
importtype{Unwrap}from"../types";
32
importtype{GithubBlog}from"../github-blog";
43
import{GithubQueryParams}from"../utils/github-query";
54
import{PagerParams}from"../utils/pager";
@@ -73,4 +72,4 @@ export const getComments = (blog: GithubBlog) => async (params: GetCommentsParam
7372

7473
exporttypeGetComments=ReturnType<typeofgetComments>;
7574

76-
exporttypeGetCommentsResult=Unwrap<ReturnType<GetComments>>;
75+
exporttypeGetCommentsResult=Awaited<ReturnType<GetComments>>;

‎src/methods/getLabels.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import{gql}from"code-tag";
22
importtype{GithubBlog}from"../github-blog";
3-
importtype{Unwrap}from"../types";
43
import{isNonNull}from"../utils/func";
54
import{PagerParams}from"../utils/pager";
65
import{Label}from"../datatypes/Label";
@@ -70,4 +69,4 @@ export const getLabels = (blog: GithubBlog) => async (params?: GetLabelsParams)
7069

7170
exporttypeGetLabels=ReturnType<typeofgetLabels>;
7271

73-
exporttypeGetLabelsResult=Unwrap<ReturnType<GetLabels>>;
72+
exporttypeGetLabelsResult=Awaited<ReturnType<GetLabels>>;

‎src/methods/getPinnedPosts.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{gql}from"code-tag";
2-
importtype{Unwrap}from"../types";
32
importtype{GithubBlog}from"../github-blog";
43
import{isNonNull}from"../utils/func";
54
import{PostReduced}from"../datatypes/PostReduced";
@@ -40,4 +39,4 @@ export const getPinnedPosts = (blog: GithubBlog) => async () => {
4039

4140
exporttypeGetPinnedPosts=ReturnType<typeofgetPinnedPosts>;
4241

43-
exporttypeGetPinnedPostsResult=Unwrap<ReturnType<GetPinnedPosts>>;
42+
exporttypeGetPinnedPostsResult=Awaited<ReturnType<GetPinnedPosts>>;

‎src/methods/getPost.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{gql}from"code-tag";
2-
importtype{Unwrap}from"../types";
32
importtype{GithubBlog}from"../github-blog";
43
import{Post}from"../datatypes/Post";
54
import{GithubQueryParams}from"../utils/github-query";
@@ -38,4 +37,4 @@ export const getPost = (blog: GithubBlog) => async (params: GetPostParams) => {
3837

3938
exporttypeGetPost=ReturnType<typeofgetPost>;
4039

41-
exporttypeGetPostResult=Unwrap<ReturnType<GetPost>>;
40+
exporttypeGetPostResult=Awaited<ReturnType<GetPost>>;

‎src/methods/getPosts.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import{gql}from"code-tag";
2-
importtype{Unwrap}from"../types";
32
importtype{GithubBlog}from"../github-blog";
43
import{GithubQueryParams}from"../utils/github-query";
54
import{isNonNull}from"../utils/func";
@@ -65,4 +64,4 @@ export const getPosts = (blog: GithubBlog) => async (params: GetPostsParams) =>
6564

6665
exporttypeGetPosts=ReturnType<typeofgetPosts>;
6766

68-
exporttypeGetPostsResult=Unwrap<ReturnType<GetPosts>>;
67+
exporttypeGetPostsResult=Awaited<ReturnType<GetPosts>>;

‎src/types/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
export*from"../__generated__/index";
2-
3-
exporttypeUnwrap<T>=TextendsPromise<inferU> ?U :never;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp