I have multiple function with the same default parameters for all of it.
Is there somehow to add default parameters for all of it without copying and paste?
// 1st function
export function modify(id, values, failCB = (err) => error("🚫 Error"), successCB = () => success("✌ Success")) {
//...
if (err) {
failCB(err.message);
} else {
successCB()
}
}
// 2nd function
export function remove(id, failCB = (err) => error("🚫 Error"), successCB = () => success("✌ Success")) {
//...
if (err) {
failCB(err.message);
} else {
successCB()
}
};