garronej / evt

💧EventEmitter's typesafe replacement
https://evt.land
MIT License
454 stars 6 forks source link

Evt is not support MediaQueryList event #41

Closed mongris closed 2 years ago

mongris commented 2 years ago

Im use useEvt in my react app to listening every DOM events. But it throw exception with follow code:

const mql = window.matchMedia('(max-width: 600px)')
useEvt(
  ctx => {
    Evt.from(ctx, mql, 'change').attach(...)
  },
  []
)

Will Evt support MediaQueryList event?

garronej commented 2 years ago

Ok yes I'll add support for it!

garronej commented 2 years ago

@mongris , This is fixed in 2.4.1, thanks for reporting.