I am working with 2 variables named locals and visitants. These variables can either be of type PlayerDto or TeamDto, which will be determined by a third variable called competitor_type. If competitor_type is player, then I need to assign a list of Players to locals and visitants, otherwise, I need to assign a list of teams.
I am currently using "any" to solve this.
locals: any
teams: any
Is there a more efficient way to handle this situation?