I am looking for a utility that will ensure that only first call of the callback is executed.
I know you can do something like code below, but I am looking for this functionality in some popular utility like lodash/underscore/async that does exactly this.
let called = false;
const result = fun(...arguments);
called = true;
If you're using this for asynchronous code, you may find that promises provide a better abstraction.
I am looking for this functionality in some popular utility like lodash/underscore/async
Are you? Sounds like you didn't actually look. Did you try googling [your library name] [the name you gave your function]?