oidc-client-rx
Version:
ReactiveX enhanced OIDC and OAuth2 protocol support for browser-based JavaScript applications
30 lines (29 loc) • 1.14 kB
JavaScript
import { Injectable, inject } from "injection-js";
import { HTTP_CLIENT } from "../http/index.js";
function _ts_decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
class HttpBaseService {
get(url, options = {}) {
return this.http.get(url, {
...options,
params: options.params?.toNgify()
});
}
post(url, body, options = {}) {
return this.http.post(url, body, {
...options,
params: options.params?.toNgify()
});
}
constructor(){
this.http = inject(HTTP_CLIENT);
}
}
HttpBaseService = _ts_decorate([
Injectable()
], HttpBaseService);
export { HttpBaseService };