# event-proxy **Repository Path**: github-image-library/event-proxy ## Basic Information - **Project Name**: event-proxy - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-18 - **Last Updated**: 2025-01-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # event-proxy [![NPM version](https://img.shields.io/npm/v/@systemlight/event-proxy.svg)](https://www.npmjs.com/package/@systemlight/event-proxy) > Event agent processing library. ### Usage ```javascript 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('只触发一次事件') }) ```