From 0265a864a57ab4296026ee16091f2c83b591429f Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond <evhan55@gmail.com> Date: Mon, 24 Sep 2018 19:06:10 -0400 Subject: [PATCH] Adding jsdocs to the alert reducers. --- src/reducers/alerts.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/reducers/alerts.js b/src/reducers/alerts.js index 3acb7097f..e0fdd72a9 100644 --- a/src/reducers/alerts.js +++ b/src/reducers/alerts.js @@ -43,6 +43,12 @@ const reducer = function (state, action) { } }; +/** + * Function to close an alert with the given index. + * + * @param {object} index - the index of the alert to close. + * @return {object} - an object to be passed to the reducer. + */ const closeAlert = function (index) { return { type: CLOSE_ALERT, @@ -50,6 +56,12 @@ const closeAlert = function (index) { }; }; +/** + * Function to show an alert with the given input data. + * + * @param {object} data - data with the following props: {message, extensionId=null} + * @return {object} - an object to be passed to the reducer. + */ const showAlert = function (data) { return { type: SHOW_ALERT, -- GitLab