UNPKG

@taro-hooks/use-request

Version:
17 lines (16 loc) 339 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function limit(fn, timespan) { var pending = false; return function () { if (pending) return; pending = true; fn.apply(void 0, arguments); setTimeout(function () { pending = false; }, timespan); }; } exports["default"] = limit;