@univerjsnetworkindexfunctionsMergeinterceptorfactory

@univerjs/network v0.5.4


Function: MergeInterceptorFactory()

function MergeInterceptorFactory<T, C>(config, options): (requestConfig, next) => Observable<HTTPEvent<unknown>>

Defined in: submodules/univer/packages/network/src/services/http/interceptors/merge-interceptor.ts:46

Type Parameters

Type Parameter
T
C

Parameters

ParameterTypeDescription
config{ getParamsFromRequest: (requestConfig) => T; isMatch: (requestConfig) => boolean; mergeParamsToRequest: (list, requestConfig) => HTTPRequest; }-
config.getParamsFromRequest(requestConfig) => TPre-process request parameters, the return value will be used as input parameters for subsequent operations The result is used as an index key
config.isMatch(requestConfig) => booleanFilter requests that need to be merged
config.mergeParamsToRequest(list, requestConfig) => HTTPRequestThe request parameters are merged to initiate the request
options{ distributeResult: (result, list) => { config: T; result: C; }[]; fetchCheck: (currentConfig) => Promise<boolean>; }-
options.distributeResult?(result, list) => { config: T; result: C; }[]The result of the request is dispatched based on the request parameters. By default each request gets the full result of the batch request
options.fetchCheck?(currentConfig) => Promise<boolean>Determine when to initiate a request By default, requests up to 300ms are automatically aggregated

Returns

Function

Parameters

ParameterType
requestConfigHTTPRequest
nextHTTPHandlerFn

Returns

Observable<HTTPEvent<unknown>>