My question is: can I do (2.) in some simpler way than a sequence of .then(proc...).then(proc...).then(proc...) callbacks? I found the asyncjs package, but I'm not sure if I can plug it somehow in my situation. The Webext API returns a JS Promise, and I'm assuming Karax callbacks cannot be async procs. I don't know JS enough to understand what I can do now, if anything at all.
Can someone possibly help me? TIA!
import asyncjs
proc main() {.async.} =
let x = await apiFunction()
main()