import { isIterable } from "@thi.ng/checks/is-iterable";
import { compR } from "./compr.js";
import { iterator1 } from "./iterator.js";
function throttle(pred, src) {
  return isIterable(src) ? iterator1(throttle(pred), src) : (rfn) => {
    const r = rfn[2];
    const _pred = pred();
    return compR(rfn, (acc, x) => _pred(x) ? r(acc, x) : acc);
  };
}
export {
  throttle
};
