Skip to content

Commit ebd2147

Browse files
authored
Returning topic on callback
What happens if you subscribe to #. You wont be able to detect from what topic is the message. I added the topic as a second parameter on the callback
1 parent b8bdde3 commit ebd2147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/angular-MQTT.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ angular.module('ngMQTT', [])
4141
});
4242
if(topic.match(regexpStr)){
4343
$rootScope.$apply(function() {
44-
callback(data);
44+
callback(data, topic);
4545
});
4646
}
4747
})

0 commit comments

Comments
 (0)