Eslint: Fix Unexpected unnamed function func-names

This is the proper and correct new way of using anonymous functions.

Reference: https://stackoverflow.com/questions/52735032/warning-unexpected-unnamed-function-func-names-under-eslint-rule
This commit is contained in:
olokos
2022-08-17 21:12:01 +02:00
parent 23b357e669
commit 87f84e993a
2 changed files with 15 additions and 15 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ import {
} from '../api/agent';
export const verifyPersistence = (config, onSuccess, onError) => {
return function (dispatch) {
return (dispatch) => {
doVerifyPersistence(
config,
() => {
@@ -29,7 +29,7 @@ export const verifyPersistence = (config, onSuccess, onError) => {
};
export const verifyHub = (config, onSuccess, onError) => {
return function (dispatch) {
return (dispatch) => {
doVerifyHub(
config,
() => {
@@ -51,7 +51,7 @@ export const verifyHub = (config, onSuccess, onError) => {
};
export const getKerberosAgentTags = (onSuccess, onError) => {
return function (dispatch) {
return (dispatch) => {
doGetKerberosAgentTags(
(data) => {
dispatch({
@@ -72,7 +72,7 @@ export const getKerberosAgentTags = (onSuccess, onError) => {
};
export const getConfig = (service, onSuccess, onError) => {
return function (dispatch) {
return (dispatch) => {
doGetConfig(
service,
(data) => {
@@ -94,7 +94,7 @@ export const getConfig = (service, onSuccess, onError) => {
};
export const saveConfig = (service, config, onSuccess, onError) => {
return function (dispatch) {
return (dispatch) => {
doSaveConfig(
service,
config,
+10 -10
View File
@@ -9,10 +9,10 @@ export function doGetConfig(onSuccess, onError) {
}
return res.data;
})
.then(function (data) {
.then((data) => {
onSuccess(data);
})
.catch(function (error) {
.catch((error) => {
onError(error);
});
}
@@ -28,10 +28,10 @@ export function doSaveConfig(config, onSuccess, onError) {
}
return res.data;
})
.then(function (data) {
.then((data) => {
onSuccess(data);
})
.catch(function (error) {
.catch((error) => {
onError(error);
});
}
@@ -45,10 +45,10 @@ export function doGetKerberosAgentTags(onSuccess, onError) {
}
return res.data;
})
.then(function (data) {
.then((data) => {
onSuccess(data);
})
.catch(function (error) {
.catch((error) => {
onError(error);
});
}
@@ -64,10 +64,10 @@ export function doVerifyPersistence(config, onSuccess, onError) {
}
return res.data;
})
.then(function (data) {
.then((data) => {
onSuccess(data);
})
.catch(function (error) {
.catch((error) => {
onError(error);
});
}
@@ -83,10 +83,10 @@ export function doVerifyHub(config, onSuccess, onError) {
}
return res.data;
})
.then(function (data) {
.then((data) => {
onSuccess(data);
})
.catch(function (error) {
.catch((error) => {
onError(error);
});
}