Adaptions of google closure library async Throttle and Debounce.
Source: https://medium.com/@alehatsman/clojurescript-throttle-debounce-a651dfb66ac
Adaptions of google closure library async Throttle and Debounce. Source: https://medium.com/@alehatsman/clojurescript-throttle-debounce-a651dfb66ac
(debounce listener interval)
Takes a listener function and interval and creates an instance of
goog.async.Debounce
Example usage:
(require '[goog.events :as gevents])
(gevents/listen
js/window
"resize"
(debounce on-resize 200))
Takes a listener function and interval and creates an instance of `goog.async.Debounce` Example usage: ```clojure (require '[goog.events :as gevents]) (gevents/listen js/window "resize" (debounce on-resize 200)) ```
(throttle listener interval)
Takes a listener function and interval and creates an instance of
goog.async.Throttle
.
Example usage:
(require '[goog.events :as gevents])
(gevents/listen
js/document
"scroll"
(throttle on-scroll 200))
Takes a listener function and interval and creates an instance of `goog.async.Throttle`. Example usage: ```clojure (require '[goog.events :as gevents]) (gevents/listen js/document "scroll" (throttle on-scroll 200)) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close