From 1db61941ed7ea11049819f72a239cabb2011e9a7 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Sat, 22 Jul 2017 00:10:45 +0700 Subject: [PATCH] Comment WithEmit --- client/coral-framework/hocs/withEmit.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/coral-framework/hocs/withEmit.js b/client/coral-framework/hocs/withEmit.js index 46c26c8f6..3a3216c8a 100644 --- a/client/coral-framework/hocs/withEmit.js +++ b/client/coral-framework/hocs/withEmit.js @@ -1,14 +1,18 @@ import React from 'react'; const PropTypes = require('prop-types'); +/** + * WithEmit provides a property `emit: (eventName, value)` + * to the wrapped component. + */ export default (WrappedComponent) => { class WithEmit extends React.Component { static contextTypes = { eventEmitter: PropTypes.object, }; - emit = (eventName, value, context) => { - this.context.eventEmitter.emit(eventName, value, context); + emit = (eventName, value) => { + this.context.eventEmitter.emit(eventName, value); }; render() {