[Refactor] Change state management structures. Async atom to be manage manually.
This commit is contained in:
@@ -3,15 +3,15 @@ import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useSelectedMicHost = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentSelectedMicHost, updateSelectedMicHost } = useStore_SelectedMicHost();
|
||||
const { currentSelectedMicHost, updateSelectedMicHost, pendingSelectedMicHost } = useStore_SelectedMicHost();
|
||||
|
||||
const getSelectedMicHost = () => {
|
||||
updateSelectedMicHost(() => new Promise(() => {}));
|
||||
pendingSelectedMicHost();
|
||||
asyncStdoutToPython("/get/selected_mic_host");
|
||||
};
|
||||
|
||||
const setSelectedMicHost = (selected_mic_host) => {
|
||||
updateSelectedMicHost(() => new Promise(() => {}));
|
||||
pendingSelectedMicHost();
|
||||
asyncStdoutToPython("/set/selected_mic_host", selected_mic_host);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user