UNPKG

@atomazing-org/mock-plop

Version:

The `@atomazing-org/mock-plop` library is a configuration script designed for Plop, a tool aimed at automating code generation within projects utilizing templates. Specifically, this script focuses on generating and updating files associated with mocks (p

16 lines (12 loc) 457 B
import { isRejectedWithValue } from '@reduxjs/toolkit' import type { Middleware } from '@reduxjs/toolkit' export const rtkQueryHandler: Middleware = () => next => action => { if (isRejectedWithValue(action)) { const payload = action.payload as { status?: number } if (payload && (payload.status === 500 || payload.status === 400)) { // eslint-disable-next-line no-console -- Временно console.log('Error') } } return next(action) }