Remove define for jsfetch (#19530)

* Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch

* Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch

* Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch

* Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch
This commit is contained in:
Juan Carlos
2022-02-25 11:34:16 -08:00
committed by GitHub
parent 9c17a32e0e
commit f0bfc0bd3f
4 changed files with 83 additions and 84 deletions

View File

@@ -190,12 +190,11 @@ runnableExamples("-r:off"):
discard example()
when defined(nimExperimentalAsyncjsThen):
block:
proc example2 {.async.} =
await fetch("https://api.github.com/users/torvalds".cstring)
.then((response: Response) => response.json())
.then((json: JsObject) => console.log(json))
.catch((err: Error) => console.log("Request Failed", err))
block:
proc example2 {.async.} =
await fetch("https://api.github.com/users/torvalds".cstring)
.then((response: Response) => response.json())
.then((json: JsObject) => console.log(json))
.catch((err: Error) => console.log("Request Failed", err))
discard example2()
discard example2()