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

awsIot.thingShadow#register() options parameter is not independently optional #106

Closed
aztecrex opened this issue Dec 27, 2016 · 4 comments
Closed

Comments

@aztecrex
Copy link

The documentation for the API shows a signature with optional options and callback parameters. The example shows the function invoked with only two parameters, the shadow name and the callback.

However, the options parameter appears to be required if a callback is supplied. If called the way shown in the example, the callback is never called. This can be fixed in the code by checking if the second argument is a function. Or it can be fixed in the documentation by enclosing the final two formal parameters in another square bracket and modifying the example to include an empty hash for the second argument.

@chaurah
Copy link

chaurah commented Dec 28, 2016

Hi @aztecrex,
Thank you for pointing this out. We will take a call on what the correct fix should be in this case and include it in the next release. Please do let us know if you have any further suggestions. Thank you for using AWS IoT.

Rahul

@psiphi75
Copy link

psiphi75 commented Jan 5, 2017

The same applies for many other functions, such as awsIot.thingShadow#publish, awsIot.thingShadow#subscribe, etc.

@fengsongAWS
Copy link
Contributor

Hi @psiphi75 ,

The subscribe and publish APIs should not be affected because it invokes the under layer mqtt API directly. The options and callback are independently optional. We will fix the thingShadow.register() API in the future release.

Thanks

@fengsongAWS
Copy link
Contributor

Fixed in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants