diff options
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -32,3 +32,16 @@ By default a debounced function returns =nil= at call time. To change this, run #+begin_src emacs-lisp (timeout-debounce! 'func 0.5 'some-return-value) #+end_src + +Instead of advising =func=, you can also create new throttled or debounced versions of it with =timeout-throttle= and =timeout-debounce=: + +#+begin_src emacs-lisp +(timeout-throttle 'func 2.0) +(timeout-debounce 'func 0.5) +#+end_src + +These return anonymous functions which you can bind to a symbol with =defalias= or =fset=: +#+begin_src emacs-lisp +(defalias 'throttled-func (timeout-throttle 'func 2.0)) +(fset 'throttled-func (timeout-throttle 'func 2.0)) +#+end_src |
