JSFiddle - React, Tailwind, and code Playground

JavaScript

//since I can't test with your code, this function simulates a dummy
// callback-er.
function call (cb) {
	cb(4);
}

function a (cb) {
	var extra = 42; //in your example, this is the db variable
	call( cb.bindAppend(null, extra) );
}

Function.prototype.bindAppend = function (thisArg) {
	var fun  = this,
		post = [].slice.call(arguments, 1);
	
	return function () {
		var args = [].slice.call(arguments).concat(post);
		
		return fun.apply(thisArg, args);
	};
}

a(function () { console.log(arguments); });