-
Notifications
You must be signed in to change notification settings - Fork 309
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
[project-sequencer-statemachine] ステートのインスタンスの作成をファクトリ関数で行うようにする #2500
[project-sequencer-statemachine] ステートのインスタンスの作成をファクトリ関数で行うようにする #2500
Conversation
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
type PartialStore = { | ||
state: { | ||
tpqn: number; | ||
sequencerSnapType: number; | ||
sequencerEditTarget: SequencerEditTarget; | ||
editorFrameRate: number; | ||
}; | ||
getters: { | ||
SELECTED_TRACK_ID: TrackId; | ||
SELECTED_TRACK: Track; | ||
SELECTED_NOTE_IDS: Set<NoteId>; | ||
}; | ||
actions: { | ||
SELECT_NOTES: (payload: { noteIds: NoteId[] }) => Promise<void>; | ||
DESELECT_NOTES: (payload: { noteIds: NoteId[] }) => Promise<void>; | ||
DESELECT_ALL_NOTES: () => Promise<void>; | ||
PLAY_PREVIEW_SOUND: (payload: { | ||
noteNumber: number; | ||
duration?: number; | ||
}) => Promise<void>; | ||
COMMAND_ADD_NOTES: (payload: { | ||
notes: Note[]; | ||
trackId: TrackId; | ||
}) => Promise<void>; | ||
COMMAND_UPDATE_NOTES: (payload: { | ||
notes: Note[]; | ||
trackId: TrackId; | ||
}) => Promise<void>; | ||
COMMAND_SET_PITCH_EDIT_DATA: (payload: { | ||
pitchArray: number[]; | ||
startFrame: number; | ||
trackId: TrackId; | ||
}) => Promise<void>; | ||
COMMAND_ERASE_PITCH_EDIT_DATA: (payload: { | ||
startFrame: number; | ||
frameLength: number; | ||
trackId: TrackId; | ||
}) => Promise<void>; | ||
}; | ||
state: Pick< | ||
Store["state"], | ||
"tpqn" | "sequencerSnapType" | "sequencerEditTarget" | "editorFrameRate" | ||
>; | ||
getters: Pick< | ||
Store["getters"], | ||
"SELECTED_TRACK_ID" | "SELECTED_TRACK" | "SELECTED_NOTE_IDS" | ||
>; | ||
actions: Pick< | ||
Store["actions"], | ||
| "SELECT_NOTES" | ||
| "DESELECT_NOTES" | ||
| "DESELECT_ALL_NOTES" | ||
| "PLAY_PREVIEW_SOUND" | ||
| "COMMAND_ADD_NOTES" | ||
| "COMMAND_UPDATE_NOTES" | ||
| "COMMAND_SET_PITCH_EDIT_DATA" | ||
| "COMMAND_ERASE_PITCH_EDIT_DATA" | ||
>; | ||
}; |
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.
StoreからPickするようにしました。
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.
ほぼLGTMです!!型サポートがちゃんとできてて便利そう!
名前だけいくつか提案しました!
typescriptの型周りの設計をどうすれば良いかの知見がない中でいくつか提案コメントもしてみました 🙇
もし共感あれば、みたいな気持ちです・・・!!
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.
LGTM!!!
型サポートをいい感じに受けつつ、かつ定義をそこまでややこしくないので良さそう!!!
2779fbe
into
VOICEVOX:project-sequencer-statemachine
内容
ステートのインスタンスの作成をファクトリ関数で行うようにします。
(ステートの中で他のステートのインスタンスの作成を行わないようにします)
関連 Issue
その他