Spaces:
Paused
Paused
Download node_modules/@reduxjs/toolkit/src/getDefaultEnhancers.ts from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40reduxjs/toolkit/src/getDefaultEnhancers.ts
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@reduxjs/toolkit/src/getDefaultEnhancers.ts
-
curl -L -o getDefaultEnhancers.ts https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40reduxjs/toolkit/src/getDefaultEnhancers.ts
1.1 kB
| import type { StoreEnhancer } from 'redux' | |
| import type { AutoBatchOptions } from './autoBatchEnhancer' | |
| import { autoBatchEnhancer } from './autoBatchEnhancer' | |
| import { Tuple } from './utils' | |
| import type { Middlewares } from './configureStore' | |
| import type { ExtractDispatchExtensions } from './tsHelpers' | |
| type GetDefaultEnhancersOptions = { | |
| autoBatch?: boolean | AutoBatchOptions | |
| } | |
| export type GetDefaultEnhancers<M extends Middlewares<any>> = ( | |
| options?: GetDefaultEnhancersOptions, | |
| ) => Tuple<[StoreEnhancer<{ dispatch: ExtractDispatchExtensions<M> }>]> | |
| export const buildGetDefaultEnhancers = <M extends Middlewares<any>>( | |
| middlewareEnhancer: StoreEnhancer<{ dispatch: ExtractDispatchExtensions<M> }>, | |
| ): GetDefaultEnhancers<M> => | |
| function getDefaultEnhancers(options) { | |
| const { autoBatch = true } = options ?? {} | |
| let enhancerArray = new Tuple<StoreEnhancer[]>(middlewareEnhancer) | |
| if (autoBatch) { | |
| enhancerArray.push( | |
| autoBatchEnhancer( | |
| typeof autoBatch === 'object' ? autoBatch : undefined, | |
| ), | |
| ) | |
| } | |
| return enhancerArray as any | |
| } | |