buses.ts 317 B

1234567891011121314151617
  1. import EventEmitter from './EventEmitter'
  2. const emitter = new EventEmitter()
  3. const init = () => {
  4. emitter.on('enter', (userinfo: string) => {
  5. console.log('hey in ~', userinfo)
  6. })
  7. emitter.once('login', (userinfo: string) => {
  8. console.log('login in ~', userinfo)
  9. })
  10. }
  11. init()
  12. export default emitter