Package Exports
- threshold-invoke
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (threshold-invoke) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
threshold
Limit function call time.
usage
import threshold, { once } from 'threshold-invoke';
let count = 0;
const fn = () => ++count;
const config = {
times: 1,
overflow: true, // throw err when rich the threshold.
// within: Date.now // "1d 2m 3s 4M 5y 6(millisecond)"
};
threshold(config, fn)();
threshold(config)(fn)();
once(fn);
// once(fn, opt)
// threshold(undefined, fn)