/* eslint-disable prefer-rest-params */
export function repaint(fn) {
    let requestId;
    return function () {
        if (requestId) {
            window.cancelAnimationFrame(requestId);
        }
        requestId = window.requestAnimationFrame(() => {
            requestId = undefined;
            fn.apply(this, [...arguments]);
        });
    };
}
//# sourceMappingURL=repaint.js.map