From d0e7f4beafefd09c5a2ba9a018157f5083bd5448 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 22 Apr 2020 16:15:46 -0300 Subject: [PATCH] Fix comment above `callBackgroundThenUpdateNoSpinner` function (#8382) The comment above this function was originally written for a different function: `callBackgroundThenUpdate`. It was mistakenly left above `callBackgroundThenUpdateNoSpinner` in #1603 when this function was added. The original `callBackgroundThenUpdate` function this was written for was removed recently in #7675, as it was no longer used. The format of the comment has also been updated to match our conventions, and JSDoc params have been added. --- ui/app/store/actions.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index f6eafd873..3763b33f4 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -1920,14 +1920,16 @@ export function setMouseUserState (isMouseUser) { } } -// Call Background Then Update -// -// A function generator for a common pattern wherein: -// We show loading indication. -// We call a background method. -// We hide loading indication. -// If it errored, we show a warning. -// If it didn't, we update the state. + +/** + * A function generator for a common pattern wherein: + * * We call a background method. + * * If it errored, we show a warning. + * * If it didn't, we update the state. + * + * @param {*} method - The background method to call + * @param {...any} args - The args to invoke the background method with + */ export function callBackgroundThenUpdateNoSpinner (method, ...args) { return (dispatch) => { method.call(background, ...args, (err) => {