is dispatching from a command an antipattern?

16 Jun 2020, 02:12

I'm thinking about passing dispatcher to a dispatch payload, in order to dispatch from the command. Is this a bad idea?

16 Jun 2020, 19:29

Hi @nik0kin, the command dispatcher supports returning new commands. Wouldn't it be suitable for your use case?

Example:

execute() {
  // perform your actions...

  return [new AnotherCommand().setPayload({ ... })];
}
16 Jun 2020, 23:00

ooohhh, I overlooked that when looking at the dispatcher typing. Thank you!