Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions js-lib/src/CompositeClosureHelper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function destroy(publicAPI, model = {}) {
}

// ----------------------------------------------------------------------------
// Event handling: onXXX(callback), fireXXX(args...)
// Event handling: onXXX(callback), fireXXX(args...) or invokeXXX(args...)
// ----------------------------------------------------------------------------

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

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

publicAPI[`fire${capitalize(eventName)}`] = triggerEvent;
publicAPI[`invoke${capitalize(eventName)}`] = triggerEvent;

publicAPI[`on${capitalize(eventName)}`] = (callback) => {
if (model.deleted) {
console.log("instance deleted - can not call any method");
Expand Down
11 changes: 0 additions & 11 deletions js-lib/src/WsLinkClient/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ function vtkWSLinkClient(publicAPI, model) {
);
});

// Handle image stream if needed
if (model.createImageStream) {
model.imageStream = vtkImageStream.newInstance();
model.imageStream.connect(session);
}

// Forward ready info as well
publicAPI.invokeConnectionReady(publicAPI);

Expand Down Expand Up @@ -185,12 +179,10 @@ const DEFAULT_VALUES = {
// protocols: null,
// connection: null,
// config: null,
// imageStream
notBusyList: [],
busyCount: 0,
timeoutId: 0,
notificationTimeout: 50,
createImageStream: true,
// configDecorator: null,
};

Expand All @@ -203,17 +195,14 @@ export function extend(publicAPI, model, initialValues = {}) {
CompositeClosureHelper.set(publicAPI, model, [
"protocols",
"notBusyList",
"createImageStream",
"configDecorator",
]);
CompositeClosureHelper.get(publicAPI, model, [
"connection",
"config",
"remote",
"imageStream",
"protocols",
"notBusyList",
"createImageStream",
"configDecorator",
]);
CompositeClosureHelper.event(publicAPI, model, "BusyChange");
Expand Down