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