Skip to content

Commit 1d37dd6

Browse files
author
Stefania
authoredJun 27, 2019
Merge pull request #100 from ilcato/master
Added method for removing property value callback
2 parents e0687ec + 96c6875 commit 1d37dd6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,16 @@ const onPropertyValue = (thingId, name, cb) => {
616616
return Promise.resolve(propOutputTopic);
617617
};
618618

619+
const removePropertyValueCallback = (thingId, name) => {
620+
if (!name) {
621+
throw new Error('Invalid property name');
622+
}
623+
const propOutputTopic = `/a/t/${thingId}/e/o`;
624+
delete propertyCallback[propOutputTopic][name];
625+
return Promise.resolve(propOutputTopic);
626+
};
627+
628+
619629
export default {
620630
connect,
621631
disconnect,
@@ -629,6 +639,7 @@ export default {
629639
sendProperty,
630640
sendPropertyAsDevice,
631641
onPropertyValue,
642+
removePropertyValueCallback,
632643
getCborValue,
633644
getSenml,
634645
ArduinoCloudError,

0 commit comments

Comments
 (0)
Please sign in to comment.