Skip to content

Commit 27fc376

Browse files
authored
docs: add note about a success implementation of latest idea in PLAN.md
1 parent 1423cbf commit 27fc376

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/PLAN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const handleKaedeMessages = (event: { data: string ) => {
8181
window.addEventListener("message", handleKaedeMessages);
8282
```
8383
84-
While it works, it doesn't look good to me. Adding a lot of window listeners can affect a launcher performance. If user has 20 extensions, that `handleKaedeMessages` function will fire on every new event in every extension, even if the event wasn't needed.
84+
While it works, it doesn't look good to me. Adding a lot of window listeners can affect launcher's performance. If user has 20 extensions, that `handleKaedeMessages` function will fire on every new event 20 times, even if no one wanted to listen to that event.
8585
8686
Now I'm suggesting the next structure:
8787
@@ -107,6 +107,8 @@ onBeforeRouteChange(() => {
107107
108108
Extensions are not needed to listen for window events anymore. Only specified actions will be triggered. Must be a perfect solution? Maybe. I'm not sure that this will work, because, well, launcher doesn't have the same scope as that extension code block where `window.__KAEDE__` was reassigned (?)
109109
110+
Update: it works, somehow. I tested it both ways: firstly, I made a Svelte plugin state change from the Launcher (in Vue), and then I made a Vue state change from the Svelte plugin.
111+
110112
</details>
111113
112114
## Auth

0 commit comments

Comments
 (0)