"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useGetDeviceInfo = void 0;
const react_1 = require("react");
const getDeviceInfo_1 = require("../actions/getDeviceInfo");
const useGetDeviceInfo = ({ getDeviceInfoAction = getDeviceInfo_1.getDeviceInfoAction, deviceId, deviceName, }) => {
    const [state, setState] = (0, react_1.useState)(getDeviceInfo_1.initialState);
    (0, react_1.useEffect)(() => {
        const sub = getDeviceInfoAction({ deviceId, deviceName }).subscribe(setState);
        return () => sub.unsubscribe();
    }, [deviceId, getDeviceInfoAction, deviceName]);
    return state;
};
exports.useGetDeviceInfo = useGetDeviceInfo;
//# sourceMappingURL=useGetDeviceInfo.js.map