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