ohif-viewer/docs/latest/extensions/lifecycle/on-mode-exit.md
Alireza 5643f8f6d2
feat: Added documentation for OHIF-v3 (#2450)
* Added docs with new screenshots

* Added doc to architecture

* Added documentations to various extension modules

* Added more documentation to modes

* Added docs to managers

* Added docs for services

* Fixed deployment docs

* Added white labelling documentation

* Added i18n docs and measurement export
2021-06-15 11:15:29 -04:00

453 B

Lifecylce Hook: onModeExit

If an extension defines the onModeExit lifecycle hook, it is called when navigating away from a mode. This hook can be used to clean up data tasks such as unregistering services, removing annotations that do not need to be persisted.

Example onModeExit hook implementation

export default {
  id: 'myExampleExtension',

  onModeExit({ servicesManager, commandsManager}) {
    myCacheServie.purge()
  },
};