From f54c960aa80c3ee8a54ed835416146a67e53415e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20BOULETKESSLER?= Date: Mon, 21 Aug 2017 09:46:10 +0200 Subject: [PATCH] rename register methods --- README.md | 4 ++-- src/component/index.js | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ecfd99b..187172b 100644 --- a/README.md +++ b/README.md @@ -40,5 +40,5 @@ Please note that you must you React with addons, so choose the appropriate built - **messageSentCallback** (`function`): a callback to know when a message has been sent - **timeDisplay** (`string`): the display format, either `ago` or `dateTime`, `ago` by default - **dateTimeFormat** (`string`): the dateTime format if **timeDisplay** is set to `dateTime` -- **registerRefreshCommentsCallback** (`function`): method to register a refresh comment callback into parent -- **unregisterRefreshCommentsCallback** (`function`): method to unregister the refresh comment callback from parent +- **registerRefreshCommentsMethod** (`function`): method to register the refresh comment method into parent +- **unregisterRefreshCommentsMethod** (`function`): method to unregister the refresh comment method from parent diff --git a/src/component/index.js b/src/component/index.js index 5eb27b0..839ae18 100644 --- a/src/component/index.js +++ b/src/component/index.js @@ -29,8 +29,8 @@ const propTypes = { messageSentCallback: PropTypes.func, timeDisplay: PropTypes.oneOf(['ago', 'dateTime']), dateTimeFormat: PropTypes.string, - registerRefreshCommentsCallback: PropTypes.func, - unregisterRefreshCommentsCallback: PropTypes.func + registerRefreshCommentsMethod: PropTypes.func, + unregisterRefreshCommentsMethod: PropTypes.func } const defaultProps = { @@ -50,8 +50,8 @@ const defaultProps = { locale: 'en', timeDisplay: 'ago', dateTimeFormat: 'DD/MM/YYYY HH:mm', - registerRefreshCommentsCallback: undefined, - unregisterRefreshCommentsCallback: undefined + registerRefreshCommentsMethod: undefined, + unregisterRefreshCommentsMethod: undefined } class Container extends Component { @@ -63,10 +63,10 @@ class Container extends Component { } componentWillMount() { - const { dispatch, apiRootUrl, concept, conceptId, locale, registerRefreshCommentsCallback } = this.props; + const { dispatch, apiRootUrl, concept, conceptId, locale, registerRefreshCommentsMethod } = this.props; - if (registerRefreshCommentsCallback) { - registerRefreshCommentsCallback(this._refreshComments); + if (registerRefreshCommentsMethod) { + registerRefreshCommentsMethod(this._refreshComments); } moment.locale(this.props.locale); @@ -81,10 +81,10 @@ class Container extends Component { } componentWillUnmount() { - const { dispatch, unregisterRefreshCommentsCallback } = this.props; + const { dispatch, unregisterRefreshCommentsMethod } = this.props; - if (unregisterRefreshCommentsCallback) { - unregisterRefreshCommentsCallback(); + if (unregisterRefreshCommentsMethod) { + unregisterRefreshCommentsMethod(); } dispatch(clearComments());