@anglr/rest
Version:
Angular module representing rest services
21 lines • 854 B
JavaScript
import { isBlank } from '@jscrpt/common';
import { IgnoredInterceptorsMiddleware } from '../middlewares';
/**
* Disables specified type of http client interceptor for all calls of applied method
* @param interceptorType - Type of interceptor that will be disabled for method to which is this attached
*/
export function DisableInterceptor(interceptorType) {
return function (_target, _propertyKey, descriptor) {
const descr = descriptor;
if (isBlank(interceptorType)) {
return descr;
}
if (!Array.isArray(descr.disabledInterceptors)) {
descr.disabledInterceptors = [];
}
descr.middlewareTypes.push(IgnoredInterceptorsMiddleware);
descr.disabledInterceptors.push(interceptorType);
return descr;
};
}
//# sourceMappingURL=disableInterceptor.decorator.js.map