Un ejemplo de cómo podemos pasar una función como parámetro para ejecutarla como callback:
import {getJSON,postJSON} from './peticiones.js';
function getCategorias(funcion) {
getJSON("https://localhost:44333/api/Categories")
.then(data => {console.log(data);funcion()})
.catch(error => console.log(error));
}
function saludo(){
console.log("hola");
}
getCategorias(saludo);