Skip to content

Commit 0effbde

Browse files
authored
Merge pull request #169 from theatersoft/master
Enable chaining on proxy EventEmitter method calls
2 parents 475fa99 + a279c97 commit 0effbde

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ build
99
zwcfg*
1010
zwscene.xml
1111
node_modules
12+
.idea

lib/openzwave-shared.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,19 @@ var ee = new EventEmitter();
3333

3434
addonModule.Emitter.prototype.addListener = function(evt, callback) {
3535
ee.addListener(evt, callback);
36+
return this;
3637
}
3738
addonModule.Emitter.prototype.on = addonModule.Emitter.prototype.addListener;
3839
addonModule.Emitter.prototype.emit = function(evt, arg1, arg2, arg3, arg4) {
39-
ee.emit(evt, arg1, arg2, arg3, arg4);
40+
return ee.emit(evt, arg1, arg2, arg3, arg4);
4041
}
4142
addonModule.Emitter.prototype.removeListener = function(evt, callback) {
4243
ee.removeListener(evt, callback);
44+
return this;
4345
}
4446
addonModule.Emitter.prototype.removeAllListeners = function(evt) {
4547
ee.removeAllListeners(evt);
48+
return this;
4649
}
4750

4851
module.exports = addonModule.Emitter;

0 commit comments

Comments
 (0)