Last active
April 26, 2024 22:11
-
-
Save freaktechnik/6249f6d185d74d4e36a33fc0837979fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const panel = new Panel({...}); | |
| const runLoop = (text, i = 0) => { | |
| // do something | |
| self.port.once("updated-something", runLoop.bind(null, text, i + 1)); | |
| self.port.emit("update-something", data); | |
| }; | |
| panel.port.on("text-changed", (text) => { | |
| runLoop(text); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.port.on("update-something", (data) => { | |
| // do something with data | |
| self.port.emit("updated-something"); | |
| }); | |
| self.port.emit("text-changed", text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment