docs: filling in preRegistration hook info
This commit is contained in:
parent
aae232fc3e
commit
8edba24eec
@ -1,12 +1,30 @@
|
|||||||
# 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 in the `ExtensionManager`.
|
before any modules are registered in the `ExtensionManager`. This hook can be
|
||||||
|
used to:
|
||||||
|
|
||||||
|
- initialize 3rd party libraries
|
||||||
|
- register event listeners
|
||||||
|
- add or call services
|
||||||
|
- add or call commands
|
||||||
|
|
||||||
|
The `preRegistration` hook receives an object containing the
|
||||||
|
`ExtensionManager`'s associated `ServicesManager`, `CommandsManager`, and any
|
||||||
|
`configuration` that was provided with the extension at time of registration.
|
||||||
|
|
||||||
|
_Example `preRegistration` hook implementation_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
id: 'MyExampleExtension',
|
id: 'MyExampleExtension',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ServicesManager} servicesManager
|
||||||
|
* @param {CommandsManager} commandsManager
|
||||||
|
* @param {object} configuration
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
preRegistration({ servicesManager, commandsManager, configuration }) {
|
preRegistration({ servicesManager, commandsManager, configuration }) {
|
||||||
console.log('Wiring up important stuff.');
|
console.log('Wiring up important stuff.');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user