ohif-viewer/docs/latest/extensions/lifecycle/pre-registration.md
2019-12-07 00:49:40 -05:00

516 B

Lifecylce Hook: preRegistration

If an extension defines the preRegistration lifecycle hook, it is called before any modules are registered in the ExtensionManager.

export default {
  id: 'MyExampleExtension',

  preRegistration({ servicesManager, commandsManager, configuration }) {
    console.log('Wiring up important stuff.');

    window.importantStuff = () => {
      console.log(configuration);
    };

    console.log('Important stuff has been wired.');
    window.importantStuff();
  },
};