Skip to content

Commit

Permalink
Chore: Add JSDoc for Emit wrapper (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press authored Oct 18, 2017
1 parent 795b170 commit 360989d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ class Preview extends EventEmitter {
}
}

/**
* Wrapper around emit to prevent errors from affecting the client.
*
* @private
* @param {string} eventName - event name to emit
* @param {Object} [data] - event name to emit
* @return {void}
*/
emit(eventName, data) {
try {
super.emit(eventName, data);
Expand Down

0 comments on commit 360989d

Please sign in to comment.