Resolving a Promise in Go #489
Unanswered
zllovesuki
asked this question in
Q&A
Replies: 1 comment
-
I'm not sure I follow... You can set any Go function as a Promise reaction. There is no direct API for this, but you can use the generic one, i.e. promise.Get("then"), AssertFunction(), call that function with your handler as the argument. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to handle resolution of a Promise created by JavaScript from Go?
With v8, there's
v8::Isolate::PerformMicrotaskCheckpoint()
to run in a loop to wait for resolution. Currently the way I'm using a helper function that takes callbacks in JavaScript:(Note that I do have
eventloop
fromhttps://github.com/dop251/goja_nodejs
as well).Beta Was this translation helpful? Give feedback.
All reactions