Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promisifyMethod return object instead of array to allow for destructuring #1186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anasik
Copy link
Contributor

@anasik anasik commented May 16, 2022

Currently, if users do this:

const result = await client.MyFunction(args)
The result will be equal to an array containing result, rawResponse, soapHeader, rawRequest, mtomAttachments. And if they want just the parsed JSON response they have to do result[0].

This is fine. But if we make promisify return an object instead of an array, they could do this:

const { result } = await client.MyFunction(args)

Currently, if users do this:
> const result =  await client.MyFunction(args) 
The result will be equal to an array containing result, rawResponse, soapHeader, rawRequest, mtomAttachments. And if they want just the parsed JSON response they have to do result[0].

This is fine. But if we make promisify return an object instead of an array, they could do this:
> const { result } =  await client.MyFunction(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant