This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* auditTime 是每次点击开始计时, 超时的时候再emit最近的一次事件 | |
* | |
* throttleTime 是每次点击emit事件, 之后的一段时间不会再触发事件 | |
* | |
* debounceTime 是每次点击重新计时, 超时的时候emit此事件 | |
*/ | |
let print = auditTime(1000, e => { | |
console.log('😋', e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue" | |
import * as constants from "./event-constant" | |
const eventMap = new Map() | |
const eventBus = { | |
data() { | |
return { | |
eventMap, | |
registerEvent: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue" | |
import * as constants from "./event-constant" | |
const eventMap = new Map() | |
const eventBus = { | |
data() { | |
return { | |
eventMap, | |
registerEvent: { |