Skip to content

Commit

Permalink
Fixed js compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Jun 9, 2024
1 parent e412b38 commit 0b26bbb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/misc/custom_async.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ when defined(js):

proc toFuture*[T](value: sink T): Future[T] {.importjs: "(Promise.resolve(#))".}

# todo: untested
proc all*(futs: varargs[Future[void]]): Future[void] {.importjs: "Promise.all(#)".}
proc all*[T](futs: varargs[Future[T]]): Future[seq[T]] {.importjs: "Promise.all(#)".}

else:
import std/[asyncdispatch, asyncfile, asyncfutures, threadpool]
export asyncdispatch, asyncfile, asyncfutures
Expand Down

0 comments on commit 0b26bbb

Please sign in to comment.