httpyac
httpyac copied to clipboard
Bug/Feature: Allow compatibility between plugins for modules running promises
Hi!
First of all, thanks for the awesome plugin! It's way better than the other HTTP Clients and it helps me a lot everyday.
My example is when I have something like:
< ./script.cjs
POST /example
{{computed_request_body}}
and on script.cjs:
async function main() {
request.variables.set('computed_request_body', await heavyComputationOrFetch())
}
main()
When using kulala.nvim, for example, it works and computed_request_body is set, while for this to work on httpYac we need to set a top-level await (otherwise the variable is set only for when running the request again). Kulala.nvim doesn't need the top-level await because it runs the script in node and waits for its execution and I'd like to know if there's a possibility that httpYac does this as well.
Thanks again for building this amazing plugin!