Skip to content

Commit f4b3f57

Browse files
committed
feat: remove key-combination/index.js bind(this)
1 parent 90550ab commit f4b3f57

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

key-combination/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@
250250

251251

252252
// 移除判断
253-
const removeEventAction = function removeEventAction (e) {
253+
const removeEventAction = (e) => {
254254
_tempMap = []
255-
}.bind(this)
255+
}
256256

257257
// 绑定动作函数
258-
const bindEventAction = function bindEventAction (e) {
258+
const bindEventAction = (e) => {
259259
const tempMapLength = _tempMap.length
260260
if (tempMapLength >= 0 && _tempMap[tempMapLength - 1] !== e.keyCode) {
261261
_tempMap.push(e.keyCode)
@@ -264,20 +264,20 @@
264264
eventList && eventList.forEach(v => {
265265
v && v(e)
266266
})
267-
}.bind(this)
267+
}
268268

269269
// 绑定存储事件回调
270270
/**
271271
* @param {String} keyCode 绑定组合键
272272
* @param {function} callback 回调函数
273273
*/
274-
const bindEvent = function binEvent(keyCode, callback) {
274+
const bindEvent = (keyCode, callback) => {
275275
const keyCodeList = keyCode.split(' ')
276276
const [first, second] = keyCodeList.map(v => keyCodesChangeKV[v])
277277
const eventKeys = [first, second].toString()
278278
eventMap[eventKeys] = eventMap[eventKeys] || []
279279
eventMap[eventKeys].push(callback)
280-
}.bind(this)
280+
}
281281

282282
// 移除绑定存储事件回调
283283
function removeListeners(keyCode, callback) {

0 commit comments

Comments
 (0)