import { isRejectedWithValue } from "@reduxjs/toolkit";
import { actions as error } from "./error/index.js";
const errorMiddleware = (api) => (next) => (action) => {
  if (isRejectedWithValue(action)) {
    api.dispatch(error.set({ messageText: action?.error?.data?.message }));
  }
  return next(action);
};
export {
  errorMiddleware
};
