[Refactor] Refactor the way import files.
Organize some codes.
This commit is contained in:
24
src-ui/logics/configs/device/useSelectedMicHost.js
Normal file
24
src-ui/logics/configs/device/useSelectedMicHost.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_SelectedMicHost } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useSelectedMicHost = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentSelectedMicHost, updateSelectedMicHost, pendingSelectedMicHost } = useStore_SelectedMicHost();
|
||||
|
||||
const getSelectedMicHost = () => {
|
||||
pendingSelectedMicHost();
|
||||
asyncStdoutToPython("/get/data/selected_mic_host");
|
||||
};
|
||||
|
||||
const setSelectedMicHost = (selected_mic_host) => {
|
||||
pendingSelectedMicHost();
|
||||
asyncStdoutToPython("/set/data/selected_mic_host", selected_mic_host);
|
||||
};
|
||||
|
||||
return {
|
||||
currentSelectedMicHost,
|
||||
getSelectedMicHost,
|
||||
updateSelectedMicHost,
|
||||
setSelectedMicHost,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user