@univerjscoreclassesAsyncinterceptormanager

@univerjs/core v0.5.4


Class: AsyncInterceptorManager<P>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:202

Type Parameters

Type Parameter
P extends Record<string, IAsyncInterceptor<any, any>>

Constructors

new AsyncInterceptorManager()

new AsyncInterceptorManager<P>(asyncInterceptorPoints): AsyncInterceptorManager<P>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:206

Parameters

ParameterType
asyncInterceptorPointsP

Returns

AsyncInterceptorManager<P>

Methods

dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:248

Returns

void


fetchThroughAsyncInterceptors()

fetchThroughAsyncInterceptors<T, C>(name, filter?): (initialValue, context) => Promise<Nullable<T>>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:217

Get the interceptors.

Type Parameters

Type Parameter
T
C

Parameters

ParameterTypeDescription
nameIAsyncInterceptor<T, C>Name of the intercepted point.
filter?(interceptor) => booleanA callback function to filter the interceptors.

Returns

Function

It will return a composed interceptor function. If you will perform the interceptor repeatedly, you should cache the result instead of calling this function multiple times.

Parameters
ParameterType
initialValueNullable<T>
contextC
Returns

Promise<Nullable<T>>


getInterceptPoints()

getInterceptPoints(): P

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:244

Returns

P


interceptAsync()

interceptAsync<T>(name, interceptor): Promise<() => boolean>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:228

Type Parameters

Type Parameter
T extends IAsyncInterceptor<any, any>

Parameters

ParameterType
nameT
interceptorT

Returns

Promise<() => boolean>