the doc is really not clear.
https://www.npmjs.com/package/debounce-promise
https://npm.runkit.com/debounce-promise
while truely, it turns out the debounce action needs to be PRE defined and evaluated.
so only the function is pre-defined like this will work
const preDefined = debounce((num)=> console.log("whatever action here", num), 100); [1, 2, 3, 4].forEach(num => { preDefined(num); }); "whatever action here" 4
while calling debounce() directly, simply like direct method calls
[1, 2, 3, 4].forEach(num => { debounce(console.log("always defining", num), 100); }); "always defining" 1 "always defining" 2 "always defining" 3 "always defining" 4