Returns a function that will only run N milliseconds after it stops being called. Or optionally will only run once during multiple calls, and won't run again until N milliseconds after the last call.
Work like any standard debounce function. The only thing needs to be notice is that if set the last argument to true. Then it will accept the first function call during the duration instead of the last one like the standard way.
## requires
* nothing
**Usage case:**
## parameters
* func - required - function to be debounced
* wait - required - delay after last call fire the func
* immediate - optional - triggers the func immediately but then won't trigger it again until the wait time has passed after the last call