- Source
Methods
(async, inner) bajo:afterAllInit()
Run after all plugins are initialized. You can use this hook to do some post-initialization process.
- Source
(async, inner) bajo:afterAllStart()
Run after all plugins are started. You can use this hook to do some post-start process.
- Source
(async, inner) bajo:afterBoot()
Run after boot process. You can use this hook to do some post-boot process.
- Source
(async, inner) bajo:afterBuildCollection(container, items)
Run after collection is built.
| Name | Type | Description |
|---|---|---|
container | string | Collection container name |
items | array.<object> | Collection items |
- Source
(async, inner) bajo:afterCollectHooks(hooks)
Run after hooks are collected. You can use this hook to modify the collected hooks before they are recognized as application hooks.
| Name | Type | Description |
|---|---|---|
hooks | Array.<module:Hook~THook> | Array of hook objects |
- Source
(async, inner) bajo:afterReadConfig(file, result, options)
Run after all read processes of a configuration file are completed.
| Name | Type | Description |
|---|---|---|
file | string | Config file path |
result | object | Resulting config object after parsing |
options | object | readConfig options |
- Source
(async, inner) bajo:beforeAllInit()
Run before all plugins are initialized. You can use this hook to do some pre-initialization process.
- Source
(async, inner) bajo:beforeAllStart()
Run before all plugins are started. You can use this hook to do some pre-start process.
- Source
(async, inner) bajo:beforeBoot()
Run before boot process. You can use this hook to do some pre-boot process.
- Source
(async, inner) bajo:beforeBuildCollection(container)
Run before collection is built.
| Name | Type | Description |
|---|---|---|
container | string | Collection container name |
- Source
(async, inner) bajo:beforeReadConfig(file, options)
Run before a configuration file is read.
| Name | Type | Description |
|---|---|---|
file | string | Config file path |
options | object | readConfig options |
- Source
(async, inner) {ns}:afterAppletRun(…args)
Run after applet is run. {ns} is the applet's namespace
| Name | Type | Attributes | Description |
|---|---|---|---|
args | any | <repeatable> | Arguments passed to the applet |
- Source
(async, inner) {ns}:afterInit()
Run after {ns} plugins are initialized. You can use this hook to do some post-initialization process.
- Source
(async, inner) {ns}:afterStart()
Run after {ns} plugins are started. You can use this hook to do some post-start process.
- Source
(async, inner) {ns}:beforeAppletRun(…args)
Run before applet is run. {ns} is the applet's namespace
| Name | Type | Attributes | Description |
|---|---|---|---|
args | any | <repeatable> | Arguments passed to the applet |
- Source
(async, inner) {ns}:beforeInit()
Run before {ns} plugins are initialized. You can use this hook to do some pre-initialization process.
- Source
(async, inner) {ns}:beforeStart()
Run after {ns} plugins are initialized. You can use this hook to do some pre-start process.
- Source
Type Definitions
THook
- Object
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Hook name | ||
ns | string | Hook namespace | ||
handler | function | Hook handler function | ||
level | number | <optional> | 999 | Hook level (lower number means higher priority) |
src | string | Hook source (origin plugin namespace). Bajo will set this automatically, any value you set will be overriden. | ||
noWait | boolean | <optional> | false | If true, Bajo will not wait for this hook to complete before proceeding to the next hook. Default is false. |
- Source