diff --git a/js-lib/src/CompositeClosureHelper/index.js b/js-lib/src/CompositeClosureHelper/index.js index 60e5ed0..54aa31b 100644 --- a/js-lib/src/CompositeClosureHelper/index.js +++ b/js-lib/src/CompositeClosureHelper/index.js @@ -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) { @@ -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; @@ -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"); diff --git a/js-lib/src/WsLinkClient/index.js b/js-lib/src/WsLinkClient/index.js index 7de8ffe..10f4429 100644 --- a/js-lib/src/WsLinkClient/index.js +++ b/js-lib/src/WsLinkClient/index.js @@ -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); @@ -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, }; @@ -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");