Skip to content

Commit 06e03d5

Browse files
committed
fix: wslinkclient event invoke/fire and remove imagestream
1 parent 4a8ee6b commit 06e03d5

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

js-lib/src/CompositeClosureHelper/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function destroy(publicAPI, model = {}) {
7474
}
7575

7676
// ----------------------------------------------------------------------------
77-
// Event handling: onXXX(callback), fireXXX(args...)
77+
// Event handling: onXXX(callback), fireXXX(args...) or invokeXXX(args...)
7878
// ----------------------------------------------------------------------------
7979

8080
function event(publicAPI, model, eventName, asynchronous = true) {
@@ -92,7 +92,7 @@ function event(publicAPI, model, eventName, asynchronous = true) {
9292
return Object.freeze({ unsubscribe });
9393
}
9494

95-
publicAPI[`fire${capitalize(eventName)}`] = (...args) => {
95+
const triggerEvent = (...args) => {
9696
if (model.deleted) {
9797
console.log("instance deleted - can not call any method");
9898
return;
@@ -117,6 +117,9 @@ function event(publicAPI, model, eventName, asynchronous = true) {
117117
}
118118
};
119119

120+
publicAPI[`fire${capitalize(eventName)}`] = triggerEvent;
121+
publicAPI[`invoke${capitalize(eventName)}`] = triggerEvent;
122+
120123
publicAPI[`on${capitalize(eventName)}`] = (callback) => {
121124
if (model.deleted) {
122125
console.log("instance deleted - can not call any method");

js-lib/src/WsLinkClient/index.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ function vtkWSLinkClient(publicAPI, model) {
122122
);
123123
});
124124

125-
// Handle image stream if needed
126-
if (model.createImageStream) {
127-
model.imageStream = vtkImageStream.newInstance();
128-
model.imageStream.connect(session);
129-
}
130-
131125
// Forward ready info as well
132126
publicAPI.invokeConnectionReady(publicAPI);
133127

@@ -185,12 +179,10 @@ const DEFAULT_VALUES = {
185179
// protocols: null,
186180
// connection: null,
187181
// config: null,
188-
// imageStream
189182
notBusyList: [],
190183
busyCount: 0,
191184
timeoutId: 0,
192185
notificationTimeout: 50,
193-
createImageStream: true,
194186
// configDecorator: null,
195187
};
196188

@@ -203,17 +195,14 @@ export function extend(publicAPI, model, initialValues = {}) {
203195
CompositeClosureHelper.set(publicAPI, model, [
204196
"protocols",
205197
"notBusyList",
206-
"createImageStream",
207198
"configDecorator",
208199
]);
209200
CompositeClosureHelper.get(publicAPI, model, [
210201
"connection",
211202
"config",
212203
"remote",
213-
"imageStream",
214204
"protocols",
215205
"notBusyList",
216-
"createImageStream",
217206
"configDecorator",
218207
]);
219208
CompositeClosureHelper.event(publicAPI, model, "BusyChange");

0 commit comments

Comments
 (0)