-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/personalization #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| interface Props { | ||
| selectedChannelId?: Id<"channels">; | ||
| screenMode: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedChannelId と screenMode は
screenMode = "channel" -> selectedChannelId は必須
screenMode = "personalization" -> selectedChannelId は不要
という関係にあるので、その関連性を反映した型にするといいね
type Selection =
| {
type: "chat";
channelId: Id<"channels">;
| {
type: "personalization";
};| import Personalization from "./Personalization.svelte"; | ||
| let selectedChannelId = $state<Id<"channels"> | undefined>(undefined); | ||
| let screenMode = $state("chat"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは、文字列ならなんでもとれるわけではなく、 "chat" か "personalization" の二択だと思うので、それを反映した型をつけるといいね
let screenMode = $state<"chat" | "personalization">("chat");
No description provided.