feat(ViewportActionMenu): window level per viewport / new patient info / colorbars/ 3D presets and 3D volume rendering (#3963)
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
This commit is contained in:
1 parent
07301fc020
commit
b7f90e3951
164 files changed
+5887
-932
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import log from './../log.js';
|
||||
|
||||
/**
|
||||
* The ServiceProvidersManager allows for a React context provider class to be registered
|
||||
* for a particular service. This allows for extensions to register services
|
||||
* with context providers and the providers will be instantiated and added to the
|
||||
* DOM dynamically.
|
||||
*/
|
||||
export default class ServiceProvidersManager {
|
||||
public providers = {};
|
||||
|
||||
public constructor() {
|
||||
this.providers = {};
|
||||
}
|
||||
|
||||
registerProvider(serviceName, provider) {
|
||||
if (!serviceName) {
|
||||
log.warn(
|
||||
'Attempting to register a provider to a null/undefined service name. Exiting early.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!provider) {
|
||||
log.warn('Attempting to register a null/undefined provider. Exiting early.');
|
||||
return;
|
||||
}
|
||||
|
||||
this.providers[serviceName] = provider;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user