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.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 4598b1844e
commit d0e7f4beaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      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: * A function generator for a common pattern wherein:
// We show loading indication. * * We call a background method.
// We call a background method. * * If it errored, we show a warning.
// We hide loading indication. * * If it didn't, we update the state.
// 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) { export function callBackgroundThenUpdateNoSpinner (method, ...args) {
return (dispatch) => { return (dispatch) => {
method.call(background, ...args, (err) => { method.call(background, ...args, (err) => {

Loading…
Cancel
Save