Hi, i am trying to call a command inside setTimeout which is also inside a command. I am sharing my code. The command inside setTimeout is not getting called, can you please help me how can i do that.
class DecideCurrentTurn extends command.Command {
execute( {diceData}) {
//set currentTurn according to diceVal
const result = diceData.reduce((dice1, dice2) => dice1.diceVal > dice2.diceVal ? dice1 : dice2);
this.state.currentTurn = result.sessionId;
this.clock.setTimeout(() => {
return [new SetInitialDiceRoll().setPayload({diceData})];
}, 1000);
}
}