2019-01-24 13:36:12 -07:00
|
|
|
import { throttle } from "lodash";
|
|
|
|
|
|
|
|
/** Too many status updates === too many screen redraws. */
|
|
|
|
export const slowDown =
|
2019-12-08 12:55:54 -07:00
|
|
|
<Returns, Args, Fn extends (u: Args) => Returns>(fn: Fn) =>
|
2019-01-24 13:36:12 -07:00
|
|
|
throttle(fn, 600, { leading: false, trailing: true });
|