We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm not fluent in English and it's my first issue, please excuse any mistakes I've made :)
I'm trying to convert GJS documentation into epub. The code block in it should be this but it looks like
const {GLib} = imports.gi; const loop = new GLib.MainLoop(null, false); // Returns a Promise that randomly fails or succeeds after one second function unreliablePromise() { return new Promise((resolve, reject) => { GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 1, () => { if (Math.random() >= 0.5) resolve('success'); else reject(Error('failure')); return GLib.SOURCE_REMOVE; }); }); } // An example async function, demonstrating how Promises can be resolved // sequentially while catching errors in a try..catch block. async function exampleAsyncFunction() { try { let count = 0; while (true) { await unreliablePromise(); log(`Promises resolved: ${++count}`); } } catch (e) { logError(e); loop.quit(); } } // Run the async function exampleAsyncFunction(); loop.run(); 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm not fluent in English and it's my first issue, please excuse any mistakes I've made :)
I'm trying to convert GJS documentation into epub.
![Screenshot 2022-05-16 at 16-36-12 Asynchronous Programming GNOME JavaScript](https://user-images.githubusercontent.com/68462995/168553222-1a2ed967-7bde-4188-bbbb-063c3a4a5b60.png)
The code block in it should be this
but it looks like
The text was updated successfully, but these errors were encountered: