document listener inputs, remove current

This commit is contained in:
David Mark Clements
2023-12-12 17:40:23 +01:00
parent 31384f5a2b
commit 7e095bc322

View File

@@ -375,13 +375,17 @@ The `listener` function is called with an `update` object of the form:
{
type: 'pear/updates',
version: { fork <Integer>, length <Integer>, key <String(hex)>, } | null,
current: { fork <Integer>, length <Integer>, key <String(hex)>, } | null,
app <Boolean>,
filename <String|null>,
reloads <Array|nulll>
}
```
* `version` is a Pear version object
* `app` indicates whether the update represents an application (`true`) or platform (`false`) update
* `filename` is supplied if the `perFile` option is `true` and is the path of the file from application root
* `reloads` is supplied if the `liveReload` option is `true` and is an array of objects containing the original, previous and next module/component instances that can be passed on to a hot-reloader. Objects take the form `{ original <Module>, previous <Module>, next <Module> }`
For launched applications, use the default behavior (`perFile: false`) to respond to platform and application updates in production.
For developed applications, the `liveReload`, `perFile` and `paths` options in combination with `pear.config.watch` and `pear.config.dev` are useful for setting up project devex hot-reload functionality. In development mode `version` and `current` will always be `null`.