UNPKG

@salesforce/design-system-react

Version:

Salesforce Lightning Design System for React

23 lines (19 loc) 560 B
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */ /* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */ function KeyBuffer() { var _this = this; this.buffer = ''; return function (key) { if (_this.timeout) { clearTimeout(_this.timeout); _this.timeout = undefined; } _this.timeout = setTimeout(function () { _this.buffer = ''; }, 400); _this.buffer = _this.buffer + key; return _this.buffer; }; } export default KeyBuffer; //# sourceMappingURL=key-buffer.js.map