#CQRS command handler typing issue

2 messages · Page 1 of 1 (latest)

merry zodiac
#

When defining the result of the the command handler as in the screenshot, the service which is consuming can return a different typing without any tslint/eslint/... error in my IDE ( Webstorm ).
How can I fix this?

chrome patio
#

Yep, you can't really enforce the return types without some custom wrappers. I've been using a package called nestjs-typed-cqrs (or something like that, I can't remember from the top of my head) that did exactly that.