docs: lifecycle hooks summary

This commit is contained in:
dannyrb 2019-12-07 00:49:40 -05:00
parent 19117167ac
commit 33a1a465ea
2 changed files with 12 additions and 6 deletions

View File

@ -91,18 +91,17 @@ const config = {
} }
``` ```
#### Runtime Extensions #### Registering at Runtime
The `@ohif/viewer` uses a [configuration file](#) at startup. The schema for The `@ohif/viewer` uses a [configuration file](#) at startup. The schema for
that file includes an `Extensions` key that supports an array of extensions to that file includes an `Extensions` key that supports an array of extensions to
register. register.
#### Bundled Extensions #### Registering at Build Time
The `@ohif/viewer` works best when built as a "Progressive Web Application" The `@ohif/viewer` works best when built as a "Progressive Web Application"
(PWA). If you know the extensions your application will need, you can specify (PWA). If you know the extensions your application will need, you can specify
them at "build time" to leverage some advantaged afforded to us by modern them at "build time" to leverage advantages afforded to us by modern tooling:
tooling:
- Code Splitting - Code Splitting
- Tree Shaking - Tree Shaking
@ -116,7 +115,14 @@ You can update the list of bundled extensions by:
### Lifecycle Hooks ### Lifecycle Hooks
... Currently, there is only a single lifecycle hook for extensions:
[`preRegistration`](./lifecycle/pre-registration.md)
If an extension defines the [`preRegistration`](./lifecycle/pre-registration.md)
lifecycle hook, it is called before any modules are registered in the
`ExtensionManager`. It's most commonly used to wire up extensions to
[services](./../services/index.md) and [commands](./modules/commands.md), and to
bootstrap 3rd party libraries.
### Modules ### Modules

View File

@ -1,7 +1,7 @@
# Lifecylce Hook: preRegistration # Lifecylce Hook: preRegistration
If an extension defines the `preRegistration` lifecycle hook, it is called If an extension defines the `preRegistration` lifecycle hook, it is called
before any modules are registered to the `ExtensionManager`. before any modules are registered in the `ExtensionManager`.
```js ```js
export default { export default {