Is the naming convention an issue? doThis defines unique logic for my_function and calls the f_get or f_put accordingly as required.
Assume variable names will be defined properly. My question is regarding the re-defining of my_function every time in doThis functions.
Is there a better way to refactor this?
f_get(..., my_function) {
axios...(...)
.then(my_function)
}
f_put(..., my_function) {
axios...(...)
.then(my_function)
}
doThis1() {
my_function = {...}
f_get(..., my_function)
}
doThis2() {
my_function = {...}
f_put(..., my_function)
}
doThis3() {
my_function = {...}
f_get(..., my_function)
}