Delay make the function execution after delayed time. Play: https://go.dev/play/p/Ivtc2ZE-Tye
(delay time.Duration, fn any, args ...any)
| 77 | // Delay make the function execution after delayed time. |
| 78 | // Play: https://go.dev/play/p/Ivtc2ZE-Tye |
| 79 | func Delay(delay time.Duration, fn any, args ...any) { |
| 80 | // Catch programming error while constructing the closure |
| 81 | mustBeFunction(fn) |
| 82 | |
| 83 | time.Sleep(delay) |
| 84 | unsafeInvokeFunc(fn, args...) |
| 85 | } |
| 86 | |
| 87 | // Debounced creates a debounced function that delays invoking fn until after wait duration have elapsed since the last time the debounced function was invoked. |
| 88 | // Deprecated: Use Debounce function instead. |
searching dependent graphs…