Skip to content

Commit b0662dd

Browse files
author
Wasin Waeosri
committed
change log:
1. Now service name is an optional parameter for requesting item 2. Add Elektron WebSocket API Webinar 3. Modify UI of index.html
1 parent 890a963 commit b0662dd

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ The project includes the following files and folder
6363
## References
6464
For further details, please check out the following resources:
6565
* [Thomson Reuters Elektron WebSocket API page](https://developers.thomsonreuters.com/websocket-api) on the [Thomson Reuters Developer Community](https://developers.thomsonreuters.com/) web site.
66+
* [Developer Webinar Recording: Introduction to Electron Websocket API](https://www.youtube.com/watch?v=CDKWMsIQfaw)
6667
* [TypeScript programming language: Documentation](https://www.typescriptlang.org/docs/home.html).
6768
* [Mozilla Developer Network: Web Workers API page](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
6869

src/json_msg_classes.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ class ItemRequestMsg implements JSONItemRequestMsg {
6161

6262
class ItemRequestMsgKey implements JSONItemRequestKey {
6363
Name: string;
64-
Service: string;
64+
Service?: string;
6565

66-
constructor(Name: string, Service: string) {
66+
constructor(Name: string, Service?: string) {
6767
this.Name = Name;
68-
this.Service = Service;
68+
if (Service !==''){
69+
this.Service = Service;
70+
}
71+
6972
}
7073
}
7174

src/json_msg_interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export interface JSONItemRequestMsg {
2323
Key: JSONItemRequestKey;
2424
}
2525

26-
//Interface for Market Price domain item request's key attribute JSON message
26+
//Interface for Market Price domain item request's key attribute JSON message, service name is an optional
2727
export interface JSONItemRequestKey {
2828
Name: string;
29-
Service: string;
29+
Service?: string;
3030
}
3131

3232
//Interface for close JSON message

web/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</head>
2323
<body>
2424
<!-- WebSocket connection UI input form -->
25-
<h4>Thomson Reuters WebSocket API with Web Workers Example</h4>
25+
<h4>Thomson Reuters WebSocket API Market Price Streaming Example with TypeScript</h4>
2626
<form class="form-inline">
2727

2828
<div class="form-group" >
@@ -34,17 +34,17 @@ <h4>Thomson Reuters WebSocket API with Web Workers Example</h4>
3434
<br/>
3535
<div class="form-group" >
3636
<label for="txtUsername">User:</label> &nbsp;
37-
<input type="text" id="txtUsername" class="form-control">&nbsp;&nbsp;
37+
<input type="text" id="txtUsername" placeholder="user" class="form-control">&nbsp;&nbsp;
3838
<button id="btnLogin" type="button" class="btn btn-sm btn-primary">Login</button> &nbsp;&nbsp;
3939
<button id="btnLogout" type="button" class="btn btn-sm btn-primary">Logout</button>
4040
</div>
4141
<br/>
4242
<br/>
4343
<div class="form-group" >
44-
<label for="txtServiceName">Name:</label> &nbsp;
45-
<input type="text" id="txtServiceName" class="form-control" placeholder="ELEKTRON_DD"> &nbsp;&nbsp;
46-
<label for="txtItemName">Name:</label>&nbsp;
47-
<input type="text" id="txtItemName" value="" class="form-control"> &nbsp;&nbsp;
44+
<label for="txtItemName">Item Name:</label>&nbsp;
45+
<input type="text" id="txtItemName" placeholder="TRI.N" value="" class="form-control"> &nbsp;&nbsp;
46+
<label for="txtServiceName">Service Name:</label> &nbsp;
47+
<input type="text" id="txtServiceName" class="form-control" placeholder="[Optional]"> &nbsp;&nbsp;
4848
<button id="btnSubscribe" type="button" class="btn btn-sm btn-primary">Subscribe</button> &nbsp;&nbsp;
4949
<button id="btnUnSubscribe" type="button" class="btn btn-sm btn-primary">Unsubscribe</button>
5050
</div>

0 commit comments

Comments
 (0)