@kitware/wslink 2.5.3 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/wslink",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Rpc and pub/sub between Python and JavaScript over WebSockets",
5
5
  "repository": {
6
6
  "type": "git",
@@ -74,7 +74,7 @@ function destroy(publicAPI, model = {}) {
74
74
  }
75
75
 
76
76
  // ----------------------------------------------------------------------------
77
- // Event handling: onXXX(callback), fireXXX(args...)
77
+ // Event handling: onXXX(callback), fireXXX(args...) or invokeXXX(args...)
78
78
  // ----------------------------------------------------------------------------
79
79
 
80
80
  function event(publicAPI, model, eventName, asynchronous = true) {
@@ -92,7 +92,7 @@ function event(publicAPI, model, eventName, asynchronous = true) {
92
92
  return Object.freeze({ unsubscribe });
93
93
  }
94
94
 
95
- publicAPI[`fire${capitalize(eventName)}`] = (...args) => {
95
+ const triggerEvent = (...args) => {
96
96
  if (model.deleted) {
97
97
  console.log("instance deleted - can not call any method");
98
98
  return;
@@ -117,6 +117,9 @@ function event(publicAPI, model, eventName, asynchronous = true) {
117
117
  }
118
118
  };
119
119
 
120
+ publicAPI[`fire${capitalize(eventName)}`] = triggerEvent;
121
+ publicAPI[`invoke${capitalize(eventName)}`] = triggerEvent;
122
+
120
123
  publicAPI[`on${capitalize(eventName)}`] = (callback) => {
121
124
  if (model.deleted) {
122
125
  console.log("instance deleted - can not call any method");
@@ -122,12 +122,6 @@ function vtkWSLinkClient(publicAPI, model) {
122
122
  );
123
123
  });
124
124
 
125
- // Handle image stream if needed
126
- if (model.createImageStream) {
127
- model.imageStream = vtkImageStream.newInstance();
128
- model.imageStream.connect(session);
129
- }
130
-
131
125
  // Forward ready info as well
132
126
  publicAPI.invokeConnectionReady(publicAPI);
133
127
 
@@ -185,12 +179,10 @@ const DEFAULT_VALUES = {
185
179
  // protocols: null,
186
180
  // connection: null,
187
181
  // config: null,
188
- // imageStream
189
182
  notBusyList: [],
190
183
  busyCount: 0,
191
184
  timeoutId: 0,
192
185
  notificationTimeout: 50,
193
- createImageStream: true,
194
186
  // configDecorator: null,
195
187
  };
196
188
 
@@ -203,17 +195,14 @@ export function extend(publicAPI, model, initialValues = {}) {
203
195
  CompositeClosureHelper.set(publicAPI, model, [
204
196
  "protocols",
205
197
  "notBusyList",
206
- "createImageStream",
207
198
  "configDecorator",
208
199
  ]);
209
200
  CompositeClosureHelper.get(publicAPI, model, [
210
201
  "connection",
211
202
  "config",
212
203
  "remote",
213
- "imageStream",
214
204
  "protocols",
215
205
  "notBusyList",
216
- "createImageStream",
217
206
  "configDecorator",
218
207
  ]);
219
208
  CompositeClosureHelper.event(publicAPI, model, "BusyChange");