A question. You said "istead of JobStartAction.build() we have to inject services via this.injector.get(JobStartAction), because our action definitions are in fact global services."
Isn't it possible to just inject them using constructor?
Hey, absolutely! You can inject them in the constructor, however, when we have a very large amount of actions then the constructor would be enormous and would take up the entire screen. So having only one service injected via constructor and then inline injecting the actions makes the class more readable.
Hi! Very interesting piece, congrats.
A question. You said "istead of JobStartAction.build() we have to inject services via this.injector.get(JobStartAction), because our action definitions are in fact global services."
Isn't it possible to just inject them using constructor?
Have a great day!
Hey, absolutely! You can inject them in the constructor, however, when we have a very large amount of actions then the constructor would be enormous and would take up the entire screen. So having only one service injected via constructor and then inline injecting the actions makes the class more readable.
Thanks for clearing that out! I agree, code is more elegant that way.