1.1.5 • Published 6 years ago
cust-event v1.1.5
cust-event
one Custom-event libs ## 一款支持自定义事件的工具函数模块
- 支持es6 Commonjs模块化引入
Install
import cust from 'cust-event'
OR
let cust = require('cust-event')
Usage
绑定事件
cust.on('event-name',function(){
//callback
})
触发事件
cust.trigger('event-name',function(){
//callback
})
取消事件
cust.off('event-name',function(){
//callback
})
只触发一次
cust.one('event-name',function(){
//callback
})