Closed Jan-Jan closed 7 years ago
Not at all. Why not sending all information you need in the cmd (message). So make the async stuff before sending de command to the domain.
Based on @adrai's answer in https://github.com/adrai/node-cqrs-domain/issues/67 I might be able to use the precondition to do something async and add that tot the aggregate. Will report back if I am successful.
Cannot set a value on the aggregate in the precondition step :-( So back to square one...
Manipulating the aggragate is only possible in the defineEvent handler
I want to do an async action in the callback of
require('cqrs-domain').defineCommand(options, callback)
. (I want to use bcrypt should by async.) How would one go about it?Eg,