ryardley / ts-bus

A lightweight JavaScript/TypeScript event bus to help manage your application architecture.
MIT License
134 stars 8 forks source link

Allow PredicateFn to return a type predicate #61

Open luxaritas opened 3 years ago

luxaritas commented 3 years ago

I found myself wanting to have a predicate function that both specified a specific type of event, but also filters further based on criteria that doesn't change the event type - this allows for the latter while still maintaining the type info of the former. Let me know if you have any concerns or if there's a better way of doing this.