Skip to content

Conversation

@Nikaidou-Shinku
Copy link
Contributor

No description provided.

@Nikaidou-Shinku
Copy link
Contributor Author

ProblemStatus 的两个字段总是同时存在或同时不存在,也许可以考虑使用:

export type ProblemStatus = {
  accepted: boolean;
  submitted: boolean;
} | { };

表示这种关系?我不知道哪种写法更好 🤔

@0f-0b
Copy link
Owner

0f-0b commented Jan 13, 2023

未登录时缺字段的情况是Maybe 类型表示的。可以用同样的方法标注 ProblemStatus 的三处使用。

@0f-0b 0f-0b merged commit fba4fd4 into 0f-0b:main Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants