import mitt from 'mitt'

export const EVENT_ENUM = {
	UPDATE_CACHE: 'updateCache'
}

export const EVENT_BUS = mitt()

// 触发缓存更新
export const cacheTriggerFunc = () => {
	EVENT_BUS.emit(EVENT_ENUM.UPDATE_CACHE, {})
}

export default {
	EVENT_ENUM,
	EVENT_BUS,
	cacheTriggerFunc
}
