Async JS in Snap!


How did you get the "with inputs" text to appear?

For the first one click the second black triangle:
image

The other "with inputs" aren't in the linked project but that is just title text followed by an input. What may not be well-known is if the title text is "$nl with inputs" then it will appear on a new line.

Nice. How about "then" and "catch"?

Might add in the future but I'm not sure how to execute blocks using rings. If you look inside the source code you will see that it wraps then and catch as a way to change a state thats used in await. Promise errors are currently thrown errors. Much like how JS await works.

As for how I could put it in my own custom block:

In my case, I directly edited the XML, but this is far easier to do. Just create the block spec using that format and you should be able to import the XML it gives you.