Enhance Connection Handling and Refactor Utility Functions #528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This pull request introduces improvements and bug fixes to the Arduino IoT JS project. The changes enhance the functionality of cloud client connections, fix minor bugs, and refactor utility functions for better type handling.
Change description
Added
onConnect
/onDisconnect
Hooks inBaseCloudClient
Support for
onConnect
andonDisconnect
hooks has been added to theBaseCloudClient
class to improve connection management.Removed Useless Logs
Unnecessary logs have been removed to reduce verbosity and clean up the code.
Fixed Minor Boolean Bug
A bug related to incorrect handling of boolean values has been fixed to ensure proper data interpretation.
Refactor Type Handling in
src/senML/index.ts
Type handling for values has been adjusted:
Number
.String
.Boolean
.Introduced
isNil
Function and Other Utility ImprovementsA new
isNil
function has been introduced to check fornull
orundefined
values. Other utility functions for type checks (isNumber
,isString
,isBoolean
,isArray
) have been improved for better reliability.Additional Notes
No specific Jira task or GitHub issue linked. However, these changes aim to improve connection handling and data consistency across the project.
Reviewer checklist
main
.