FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

SystemLight/event-proxy: :pager: Event agent processing library · GitHub

Repository files navigation

event-proxy

Event agent processing library.

Usage

eventProxy('click', '.selector').on(function (e) {
    console.log('事件触发')
})

eventProxy('click', '.parent', '.selector').on(function (e) {
    console.log('事件代理')
})

eventProxy('click', '.parent', '.selector').use(function (e, next) {
    console.log('before middleware')
    next()
}).on(function (e) {
    console.log('中间件')
}).use(function (e, next) {
    console.log('after middleware')
    // 触发一次后关闭
    this.off()
    next()
})

eventProxy('click', '.parent', '.selector').one(function (e) {
    console.log('只触发一次事件')
})

About

📟 Event agent processing library

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from SystemLight/T-webpack5

Back | FazBrowse Home | New Git URL