Skip to content

Commit

Permalink
Merge pull request #14 from cpunion/add-missing-functions
Browse files Browse the repository at this point in the history
Add function EventEmitter.removeListener, compatible react-native EventEmitter path
  • Loading branch information
flyskywhy authored Dec 19, 2017
2 parents 150bae1 + c76ea20 commit 47f722c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Libraries/EventEmitter/EventEmitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var EventEmitter = require('../vendor/EventEmitter');
module.exports = EventEmitter;
9 changes: 9 additions & 0 deletions Libraries/vendor/emitter/EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ class EventEmitter {
});
}

/**
* Remove a specific listener.
*
* @param {Object} listener - Created by addListener
*/
removeListener(listener: Object) {
this._subscriber.removeSubscription(listener)
}

/**
* Removes all of the registered listeners, including those registered as
* listener maps.
Expand Down

0 comments on commit 47f722c

Please sign in to comment.