import { useState } from "react";
import { useSelector, shallowEqual } from "react-redux";
function useStateSelector(selectStateFieldFunc, fieldName = "", {
  defaultValue = void 0,
  equalityFn = void 0
} = {}) {
  const [finalDefaultValue] = useState(
    defaultValue
  );
  return useSelector(
    selectStateFieldFunc(fieldName, finalDefaultValue),
    equalityFn
  );
}
function useStateSelectorShallow(selectStateFieldFunc, fieldName = "", {
  defaultValue = void 0,
  equalityFn = shallowEqual
} = {}) {
  return useStateSelector(selectStateFieldFunc, fieldName, {
    defaultValue,
    equalityFn
  });
}
export {
  useStateSelector,
  useStateSelectorShallow
};
