Unify async macro and futures for js and native targets
This commit is contained in:
parent
67ac1aef59
commit
c93655e8b4
7 changed files with 43 additions and 4 deletions
|
|
@ -139,3 +139,7 @@ macro async*(arg: untyped): untyped =
|
|||
proc newPromise*[T](handler: proc(resolve: proc(response: T))): Future[T] {.importcpp: "(new Promise(#))".}
|
||||
## A helper for wrapping callback-based functions
|
||||
## into promises and async procedures
|
||||
|
||||
proc newPromise*(handler: proc(resolve: proc())): Future[void] {.importcpp: "(new Promise(#))".}
|
||||
## A helper for wrapping callback-based functions
|
||||
## into promises and async procedures
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue