From 360989d23cb8c51a1f3e3d10632f1fb56638de1b Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Wed, 18 Oct 2017 15:55:48 -0700 Subject: [PATCH] Chore: Add JSDoc for Emit wrapper (#442) --- src/lib/Preview.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/Preview.js b/src/lib/Preview.js index 70537b54a..484507764 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -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);