UNPKG

@normy/rtk-query

Version:

rtk-query addon for normy - automatic normalization and data updates for data fetching libraries

10 lines (9 loc) 656 B
import { type Dispatch, type Middleware } from '@reduxjs/toolkit'; import type { createApi } from '@reduxjs/toolkit/query'; import { createNormalizer, type NormalizerConfig } from '@normy/core'; export { getId, arrayHelpers, createArrayHelpers } from '@normy/core'; export declare const getNormalizer: (dispatch: Dispatch) => ReturnType<typeof createNormalizer>; export declare const createNormalizationMiddleware: (api: ReturnType<typeof createApi>, normalizerConfig?: Omit<NormalizerConfig, "structuralSharing"> & { normalizeQuery?: (queryType: string) => boolean; normalizeMutation?: (mutationEndpointName: string) => boolean; }) => Middleware;