Closed simlej closed 2 years ago
Hey @simlej! 👋🏻
Thanks for your PR!
I was thinking about doing something similar to what is done in the Adonis Event system.
declare module '@ioc:Adonis/Core/Event' {
interface EventsList {
'new:user': { id: number; email: string }
}
}
What do you think?
📚 https://docs.adonisjs.com/guides/events#making-events-type-safe
Oh nice !
I didn't know the ioc pattern on adonis, I have never really used adonis , I use to work with nestjs in my office.
I made another commit, let me know if this is what you thinking.
(Sorry this is my first PR)
Oh wow! I wasn't expecting you to update the PR directly haha 👍🏻 Thanks! 🤗
Hello 👋
I saw the note in your readme
You can let the user set it's own interface for the payload with a generic on the dispatch method
Hope it's helps