UNPKG

@pubby/sdk

Version:
13 lines (10 loc) 321 B
import { Transform } from '../lib/transform.js'; function debounce(time) { if (time === void 0) { time = 500; } var timer; return new Transform(function (data, cb) { clearTimeout(timer); timer = setTimeout(function () { return cb(null, data); }, time); }); } export { debounce };