JSFiddle - React, Tailwind, and code Playground
by KyleMuir
JavaScript
//Real call to update stuff
var myFunc = function(a,b,c){console.log('a: ' + a + ', b: ' +b + ', c: ' + c)}
//Set up a closure which has your parameters for you various calls in it
var wrappedFunc = function() {
myFunc(1, 2, 3);
}
//Here's the general process thing we want to pass our closure to
var generalProcessThing = function(wrappedFunction) {
var isLocked = true;
wrappedFunction();
var locked = false;
};
//now execute it.
generalProcessThing(wrappedFunc);