Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
chore: propagate changeClient
Browse files Browse the repository at this point in the history
  • Loading branch information
everhardt committed Oct 18, 2019
1 parent 508f00d commit 1d3ab89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"scripts": {
"start": "npm run watch-ts",
"build": "npm run build:esm && npm run build:cjs",
"build:cjs": "tsc",
"build:esm": "tsc -m es6 --outDir esm",
"build:cjs": "rm -rf cjs/ && tsc",
"build:esm": "rm -rf esm/ && tsc -m es6 --outDir esm",

This comment has been minimized.

Copy link
@vidavidorra

vidavidorra Oct 18, 2019

You could add the --clean parameter to tsc (https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript) or do you need to do more extensive cleanup here?

This comment has been minimized.

Copy link
@everhardt

everhardt Oct 18, 2019

Author Collaborator

I looked for it, but found that it did not exist:

Apparently --clean only works in build mode, which is quite recent. I'll put it on the todo ;)
.

"watch-ts": "tsc -w",
"lint": "tsc && eslint \"src/*.{js,ts}\"",
"test": "jest --forceExit --coverage --verbose",
Expand Down
4 changes: 0 additions & 4 deletions src/comms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ class Comms {
this.axios = axios;
}

set baseURL(baseURL: string) {
this.axios.defaults.baseURL = baseURL;
}

login(jwt: string, clientHashId: string): void {
this.axios.defaults.headers.common.Authorization = `Bearer ${jwt}`;
this.axios.defaults.headers.common['Client-Hash-Id'] = clientHashId;
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class PlatformSdk {
return response;
}

changeClient(clientHashId: string): void {
this.comms.changeClient(clientHashId);
}

logout(): void {
this.comms.logout();
}
Expand Down

0 comments on commit 1d3ab89

Please sign in to comment.