@reduxjs/toolkit
Version:
The official, opinionated, batteries-included toolset for efficient Redux development
15 lines (13 loc) • 371 B
text/typescript
import type { InternalHandlerBuilder } from './types'
import { registerMiddleware } from './registration'
export const buildDevCheckHandler: InternalHandlerBuilder = ({
api,
context: { apiUid },
reducerPath,
}) => {
return (action, mwApi) => {
if (api.util.resetApiState.match(action)) {
registerMiddleware(api, mwApi, apiUid, reducerPath)
}
}
}