import { useEffect } from "react";
import { useAppDispatch } from "./useAppDispatch.js";
const useInjectSideEffect = (listener) => {
  const dispatch = useAppDispatch();
  useEffect(() => {
    const unsubscribe = dispatch(listener);
    return () => {
      dispatch(unsubscribe);
    };
  }, [listener, dispatch]);
};
export {
  useInjectSideEffect
};
