The value type processed by the interceptors.
Add an interceptor and return its identifier.
The interceptor function to register.
The numeric id that can later be used with remove.
Remove all registered interceptors.
Nothing.
After calling this, count will return 0.
Remove an interceptor by its identifier.
The id previously returned by add.
true if an interceptor was removed; otherwise false.
Run all interceptors in sequence on an input value and return the final result.
Supports both sync and async interceptors; the return type is always Promise<T>
for consistency.
The initial value to pass to the first interceptor.
A promise resolving to the final value after all interceptors have run.
Manages a list of interceptors and provides a way to run them in sequence.
Interceptors are executed in insertion order. Each interceptor receives the result of the previous interceptor (or the initial input for the first one) and may return a new value synchronously or asynchronously.
Remarks
This class snapshots the current interceptor list at invocation time so additions/removals during
rundo not affect the in-flight execution.Example