create-nova-expo-template
Version:
A template for creating a new React Native app using Expo and TypeScript, with a focus on performance and best practices.
16 lines (11 loc) • 406 B
text/typescript
import { isRejectedWithValue } from "@reduxjs/toolkit";
import HandleErrors from "@/utils/handleErrors";
type NextFunction = (action: any) => void;
const rtkQueryErrorLogger = () => (next: NextFunction) => (action: any) => {
if (isRejectedWithValue(action)) {
// @ts-ignore
HandleErrors(action?.payload?.data);
}
return next(action);
};
export default rtkQueryErrorLogger;