Skip to content

Commit

Permalink
Bump TypeScript version to 2.4.2
Browse files Browse the repository at this point in the history
* This is due to a bug about spread operator usage fixed on TypeScript 2.4.0 (microsoft/TypeScript#5296)
* With this change now a warning will be given about the TS version used. This is expected, you see the discussion about it  on angular/angular-cli#7625
  • Loading branch information
calvellido committed Sep 29, 2017
1 parent b23ba07 commit d74f0ee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "2.3.4"
"typescript": "2.4.2"
}
}
23 changes: 16 additions & 7 deletions src/app/shared/metric.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ export class Metric {
* parameters and/or using interfaces.
*
* For the sake of brevity and simplicity of this model we are gonna
* assume only one single constructor right now (being a single string array
* with all data), and depending on the mileage we might take another route.
* assume only one single constructor right now
* (̶b̶e̶i̶n̶g̶ ̶a̶ ̶s̶i̶n̶g̶l̶e̶ ̶s̶t̶r̶i̶n̶g̶ ̶a̶r̶r̶a̶y̶ ̶w̶i̶t̶h̶ ̶a̶l̶l̶ ̶d̶a̶t̶a̶)̶,
* (being the four parameters of the model),
* and depending on the mileage we might take another route.
*/
constructor(metricData: Array<string>) {
this.microservice = metricData[0];
this.date = new Date(+metricData[1]);
this.metric = metricData[2];
this.value = +metricData[3];
// constructor(metricData: Array<string>) {
// this.microservice = metricData[0];
// this.date = new Date(+metricData[1]);
// this.metric = metricData[2];
// this.value = +metricData[3];
// }

constructor(microservice?: string, date?: string, metric?: string, value?: string) {
this.microservice = microservice;
this.date = new Date(+date);
this.metric = metric;
this.value = +value;
}

}
2 changes: 1 addition & 1 deletion src/app/ws-viewer/ws-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class WsViewerComponent implements OnInit {
// this.subscription = this.wsService.getSubject('handshake')
this.subscription = this.wsService.getSubject()
.subscribe(
async (msg) => this.metric = new Metric((await msg).split(' '))
async (msg) => this.metric = new Metric(...(await msg).split(' '))
);
}

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5274,9 +5274,9 @@ type-is@~1.6.15:
media-typer "0.3.0"
mime-types "~2.1.15"

typescript@2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
typescript@2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844"

"typescript@>=2.0.0 <2.6.0", typescript@^2.3.3:
version "2.5.2"
Expand Down

0 comments on commit d74f0ee

Please sign in to comment.