[Refactor] Refactor the way import files.
Organize some codes.
This commit is contained in:
18
src-ui/logics/configs/device/useMicHostList.js
Normal file
18
src-ui/logics/configs/device/useMicHostList.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useStore_MicHostList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useMicHostList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentMicHostList, updateMicHostList, pendingMicHostList } = useStore_MicHostList();
|
||||
|
||||
const getMicHostList = () => {
|
||||
pendingMicHostList();
|
||||
asyncStdoutToPython("/get/data/mic_host_list");
|
||||
};
|
||||
|
||||
return {
|
||||
currentMicHostList,
|
||||
getMicHostList,
|
||||
updateMicHostList,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user