[Refactor] Change state management structures. Async atom to be manage manually.

This commit is contained in:
Sakamoto Shiina
2024-09-23 03:44:33 +09:00
parent 586aaf0091
commit 0616092eff
49 changed files with 295 additions and 190 deletions

View File

@@ -3,15 +3,15 @@ import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useSelectedSpeakerDevice = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentSelectedSpeakerDevice, updateSelectedSpeakerDevice } = useStore_SelectedSpeakerDevice();
const { currentSelectedSpeakerDevice, updateSelectedSpeakerDevice, pendingSelectedSpeakerDevice } = useStore_SelectedSpeakerDevice();
const getSelectedSpeakerDevice = () => {
updateSelectedSpeakerDevice(() => new Promise(() => {}));
pendingSelectedSpeakerDevice();
asyncStdoutToPython("/get/selected_speaker_device");
};
const setSelectedSpeakerDevice = (selected_speaker_device) => {
updateSelectedSpeakerDevice(() => new Promise(() => {}));
pendingSelectedSpeakerDevice();
asyncStdoutToPython("/set/selected_speaker_device", selected_speaker_device);
};