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