tincture.async

Adaptions of google closure library async Throttle and Debounce.

Source: https://medium.com/@alehatsman/clojurescript-throttle-debounce-a651dfb66ac

debounce

(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))

throttle

(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))