Closed aztecrex closed 7 years ago
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
The same applies for many other functions, such as awsIot.thingShadow#publish
, awsIot.thingShadow#subscribe
, etc.
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
Fixed in v2.0.0
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.