import { useEffect, useState } from "react";
import { getDeviceInfoAction as defaultGetDeviceInfoAction, initialState, } from "../actions/getDeviceInfo";
export const useGetDeviceInfo = ({ getDeviceInfoAction = defaultGetDeviceInfoAction, deviceId, deviceName, }) => {
    const [state, setState] = useState(initialState);
    useEffect(() => {
        const sub = getDeviceInfoAction({ deviceId, deviceName }).subscribe(setState);
        return () => sub.unsubscribe();
    }, [deviceId, getDeviceInfoAction, deviceName]);
    return state;
};
//# sourceMappingURL=useGetDeviceInfo.js.map