Skip to content

Commit

Permalink
Add a comment clarifying removeListener
Browse files Browse the repository at this point in the history
  • Loading branch information
jwolski committed Oct 6, 2015
1 parent bf1dbce commit 4910763
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/membership/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ Membership.prototype.update = function update(changes, isLocal) {
continue;
}

// One-time subscription for batching applied updates
// One-time subscription for batching applied updates. Make
// sure to unsubscribe immediately after evaluating the update.
// Events are expected to be emitted synchronously and are not
// guaranteed if the update is determined to be invalid or
// redundant.
member.once('updated', onMemberUpdated);
member.evaluateUpdate(change);
member.removeListener('updated', onMemberUpdated);
Expand Down

0 comments on commit 4910763

Please sign in to comment.