Skip to content

Commit f4f19b3

Browse files
authored
clarify async examples
1 parent a141d28 commit f4f19b3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

content/reference/async-functions.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ until the `Promise` resolves and yields its value.
2525
(+ n x)))
2626
----
2727

28+
----
29+
(fn ^:async [n]
30+
(let [x (await (js/Promise.resolve 10))]
31+
(+ n x)))
32+
----
33+
2834
[source,clojure]
2935
----
3036
(defn ^:async foo [n]

0 commit comments

Comments
 (0)