UNPKG

@maicol07/coloquent

Version:

Library for retrieving model objects from a JSON-API, with a fluent syntax inspired by Laravel Eloquent.

22 lines 859 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AxiosHttpClientPromise = void 0; const AxiosHttpClientResponse_1 = require("./AxiosHttpClientResponse"); class AxiosHttpClientPromise { constructor(axiosPromise) { this.axiosPromise = axiosPromise; } then(onFulfilled, onRejected) { const wrappedOnFulfilled = onFulfilled !== undefined ? (axiosResponse => onFulfilled(new AxiosHttpClientResponse_1.AxiosHttpClientResponse(axiosResponse))) : undefined; return this.axiosPromise.then(wrappedOnFulfilled, onRejected); } catch(onRejected) { return this.axiosPromise.catch(onRejected); } } exports.AxiosHttpClientPromise = AxiosHttpClientPromise; //# sourceMappingURL=AxiosHttpClientPromise.js.map