I am using quickjs
js engine. As a part of my requirments, I wanted to create a Promise and do certain actions when its resolved or rejected. (Basically do set then
and catch
functions).
I know promise is created as such:
JSValue resolvingFuncs[2];
JSValue promise = JS_NewPromiseCapability(ctx,resolvingFuncs);
The two resolving functions be the resolve
and reject
. But how do I set then
and catch
functions ?