Skip to content

Commit

Permalink
Changing Synchronizer properties visibility and exporting the sync ca… (
Browse files Browse the repository at this point in the history
#3)

* Changing Synchronizer properties visibility and exporting the sync callbacks to be used outside the library

* Fixing PR comments

* Renaming callback name
  • Loading branch information
andrebot authored Dec 4, 2023
1 parent 1c39bc2 commit 3f8e564
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/tools/src/store/SynchronizerManager/Synchronizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ class Synchronizer {
this.id = synchronizerId;
}

public shouldIgnoreFiredEvents(): boolean {
return this._ignoreFiredEvents;
}

/**
* "Returns true if the synchronizer is disabled."
* @returns A boolean value.
Expand Down Expand Up @@ -199,7 +203,7 @@ class Synchronizer {
});
}

private fireEvent(sourceViewport: Types.IViewportId, sourceEvent: any): void {
public fireEvent(sourceViewport: Types.IViewportId, sourceEvent: any): void {
if (this.isDisabled() || this._ignoreFiredEvents) {
return;
}
Expand Down Expand Up @@ -238,7 +242,7 @@ class Synchronizer {
}
}

private _onEvent = (evt: any): void => {
public _onEvent(evt: any): void {
if (this._ignoreFiredEvents === true) {
return;
}
Expand Down
11 changes: 11 additions & 0 deletions packages/tools/src/synchronizers/callbacks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import cameraSyncCallback from './cameraSyncCallback';
import stackImageSyncCallback from './stackImageSyncCallback';
import voiSyncCallback from './voiSyncCallback';
import zoomPanSyncCallback from './zoomPanSyncCallback';

export {
cameraSyncCallback,
stackImageSyncCallback,
voiSyncCallback,
zoomPanSyncCallback,
};
2 changes: 2 additions & 0 deletions packages/tools/src/synchronizers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import createCameraPositionSynchronizer from './synchronizers/createCameraPositi
import createVOISynchronizer from './synchronizers/createVOISynchronizer';
import createZoomPanSynchronizer from './synchronizers/createZoomPanSynchronizer';
import createStackImageSynchronizer from './synchronizers/createStackImageSynchronizer';
import * as synchronizerCallbacks from './callbacks';

export {
createCameraPositionSynchronizer,
createVOISynchronizer,
createZoomPanSynchronizer,
createStackImageSynchronizer,
synchronizerCallbacks,
};

0 comments on commit 3f8e564

Please sign in to comment.