@eccenca/gui-elements
Version:
GUI elements based on other libraries, usable in React application, written in Typescript.
18 lines • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.debouncedLinter = void 0;
const lodash_1 = require("lodash");
const DEBOUNCE_TIME = 500;
const debouncedLinter = (lintFunction, time = DEBOUNCE_TIME) => {
const debouncedFn = (0, lodash_1.debounce)((view, resolve) => {
const diagnostics = lintFunction(view);
resolve(diagnostics);
}, time);
return (view) => {
return new Promise((resolve) => {
debouncedFn(view, resolve);
});
};
};
exports.debouncedLinter = debouncedLinter;
//# sourceMappingURL=debouncedLinter.js.map