mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Implement UI event dispatcher/listener (#4492)
* page change event * expose event to plugin api * Update UIPluginApi.md * Add to example plugin --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -136,3 +136,11 @@ Registers an after function. An after function is called after the render functi
|
||||
| `fn` | `Function` | The after function. It accepts the same arguments as the original render function, plus the result of the original render function, and is expected to return the rendered component. |
|
||||
|
||||
Returns `void`.
|
||||
|
||||
#### `PluginApi.Event`
|
||||
|
||||
Allows plugins to listen for Stash's events.
|
||||
|
||||
```js
|
||||
PluginApi.Event.addEventListener("stash:location", (e) => console.log("Page Changed", e.detail.data.location.pathname))
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user