1234567891011121314151617 |
- import EventEmitter from './EventEmitter'
- const emitter = new EventEmitter()
- const init = () => {
- emitter.on('enter', (userinfo: string) => {
- console.log('hey in ~', userinfo)
- })
- emitter.once('login', (userinfo: string) => {
- console.log('login in ~', userinfo)
- })
- }
- init()
- export default emitter
|