I am not sure if it's reasonable to pass the class itself in the constructor, like this:
class OngoingActions {
constructor(Activation) {
this._actions = {
onTurnStart: [new Activation(), new Activation()],
onTurnEnd: [new Activation(), new Activation()],
onDraw: [new Activation(), new Activation()],
onMove: new Activation()
};
}
}
I understand that for dependency injection you need to pass an instance of the class. It would feel a bit akward to pass 7 or more instances of the same class in the constructor. I could also import the whole '_actions' object, but it feels nice to see the structure of the object in the same class. What would be the best aproach to deal with this?