Sean C. Roach
Sean C. Roach15mo ago

How to do callbacks with `deno_core`?

Hello! I've been inspired to write an application after reading this article: https://deno.com/blog/roll-your-own-javascript-runtime-pt3. Of course, I had to modify some of the code due to some version changes since the release of that blog post. Here's the problem! I'm using a cut-down version of deno (implementing my own ops) as a runtime for plugins, written with JS/TS to modify a VTT. In this architecture, you might want plugins to subscribe to events and to have Rust emit those events. However, I have no clue how I could do this, or even if I could do this. Furthermore, it's a common occurrence for an application like this to have one "system", which establishes some base functionality, and then "modules" which overwrite, edit, or delete parts of a system with their own code. For instance, a system might declare "when button X is pressed, roll a d6 and send the message to the chat", one module might go in and say "oh, that d6 is a d8", and another might change how that chat message is formatted. I'm at an utter loss, in over my head, and ecstatic to use Deno, but the internal docs and examples have me at a complete standstill. If others far smarter than I could provide a helping hand, or a definitive no, anything would be appreciated.
0 Replies
No replies yetBe the first to reply to this messageJoin