Skip to content

Instantly share code, notes, and snippets.

@sudomann
Created December 13, 2020 21:18
Show Gist options
  • Save sudomann/55e6209516aa8422c174c28df1b01fea to your computer and use it in GitHub Desktop.
Save sudomann/55e6209516aa8422c174c28df1b01fea to your computer and use it in GitHub Desktop.
import { authClient } from "./auth-client";
import { httpClient } from "./http-client";
import { IllegalModificationError } from "./errors";
export const Transport = {
get Auth() {
return authClient;
},
get Http() {
return httpClient;
},
// Disallow changing Auth and Http
set Auth(something) {
throw IllegalModificationError(something, "Auth");
},
set Http(something) {
throw IllegalModificationError(something, "Http");
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment