import { useEffect } from "react";
import { addMiddleware, removeMiddleware } from "./appMiddleware.js";
const useAppMiddleware = ({
  key,
  middleware
}) => useEffect(() => {
  addMiddleware({ key, middleware });
  return () => {
    removeMiddleware(key);
  };
}, [key, middleware]);
export {
  useAppMiddleware
};
