1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

Add guides on Getting Started with JS (#4150)

- Get started section added to the JS docs
- Small fixes in the JS modules docs
This commit is contained in:
Ruslan Nadyrshin
2025-03-18 20:08:23 +04:00
committed by GitHub
parent 9a8dcc340f
commit 02dedd60f3
25 changed files with 343 additions and 123 deletions

View File

@@ -1,6 +1,5 @@
# js_event_loop {#js_event_loop}
# Event Loop module {#js_event_loop}
# Event Loop module
```js
let eventLoop = require("event_loop");
```
@@ -84,7 +83,7 @@ Because we have two extra arguments, if we return anything other than an array
of length 2, the arguments will be kept as-is for the next call.
The first two arguments that get passed to our callback are:
- The subscription manager that lets us `.cancel()` our subscription
- The subscription manager that lets us `.cancel()` our subscription.
- The event item, used for events that have extra data. Timer events do not,
they just produce `undefined`.