ngx-restful-client
Version:
The ultimate Angular library to exquisitely declare and implement the REST APIs you'll use in your application.
31 lines (30 loc) • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var operators_1 = require("rxjs/operators");
var rxjs_1 = require("rxjs");
var logger_1 = require("./logger");
exports.logger = logger_1.logger;
exports.LoggerConfig = logger_1.LoggerConfig;
var lean_rest_resource_1 = require("./lean-rest-resource");
exports.concatPath = lean_rest_resource_1.concatPath;
exports.LeanRestResource = lean_rest_resource_1.LeanRestResource;
var http_types_1 = require("./http-types");
exports.ContentType = http_types_1.ContentType;
exports.MimeTypes = http_types_1.MimeTypes;
exports.ngxCatchError = function (handleError) {
return operators_1.catchError(function (e) {
logger_1.logger.debug('Error while processing observable.', e);
if (!!handleError) {
handleError(e);
return rxjs_1.EMPTY;
}
return rxjs_1.throwError(e);
});
};
exports.ngxTake = function (count, handleError) {
return rxjs_1.pipe(operators_1.take(count), exports.ngxCatchError(handleError));
};
exports.ngxTakeOne = function (handleError) { return exports.ngxTake(1, handleError); };
exports.ngxApiTakeUntil = function (unsubscriber$, handleError) {
return rxjs_1.pipe(operators_1.takeUntil(unsubscriber$), exports.ngxCatchError(handleError));
};