mirror of
https://github.com/stashapp/stash.git
synced 2025-12-16 20:07:05 +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:
@@ -1,6 +1,9 @@
|
||||
interface IPluginApi {
|
||||
React: typeof React;
|
||||
GQL: any;
|
||||
Event: {
|
||||
addEventListener: (event: string, callback: (e: CustomEvent) => void) => void;
|
||||
};
|
||||
libraries: {
|
||||
ReactRouterDOM: {
|
||||
Link: React.FC<any>;
|
||||
@@ -53,6 +56,8 @@ interface IPluginApi {
|
||||
NavUtils
|
||||
} = PluginApi.utils;
|
||||
|
||||
PluginApi.Event.addEventListener("stash:location", (e) => console.log("Page Changed", e.detail.data.location.pathname, e.detail.data.location.search))
|
||||
|
||||
const ScenePerformer: React.FC<{
|
||||
performer: any;
|
||||
}> = ({ performer }) => {
|
||||
|
||||
Reference in New Issue
Block a user