UNPKG

@herlinus/coloquent

Version:

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

18 lines 658 B
import { AxiosHttpClientResponse } from "./AxiosHttpClientResponse"; export class AxiosHttpClientPromise { constructor(axiosPromise) { this.axiosPromise = axiosPromise; } then(onFulfilled, onRejected) { const wrappedOnFulfilled = onFulfilled !== undefined ? (axiosResponse => onFulfilled(new AxiosHttpClientResponse(axiosResponse))) : undefined; return this.axiosPromise.then(wrappedOnFulfilled, onRejected); } catch(onRejected) { return this.axiosPromise.catch(onRejected); } } //# sourceMappingURL=AxiosHttpClientPromise.js.map