uno-js
Version:
JS/TS common used functions, zero dependencies
16 lines (15 loc) • 427 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.asyncOnEnterKey = exports.onEnterKey = void 0;
const onEnterKey = (callback) => (ev) => {
if (ev.keyCode === 13) {
callback();
}
};
exports.onEnterKey = onEnterKey;
const asyncOnEnterKey = (callback) => async (ev) => {
if (ev.keyCode === 13) {
await callback();
}
};
exports.asyncOnEnterKey = asyncOnEnterKey;