1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

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.
This commit is contained in:
Mark Stacey 2020-04-22 16:15:46 -03:00 committed by GitHub
parent 4598b1844e
commit d0e7f4beaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {