How to add call back when more than 2 states update at the same time. please check bellow code of class component where I add a call back when that states will updated successfully.
this.setState({liveMatches: finalMatches, isLoading: false, runningFetch: false, disbleSportsSwitch:false}, ()=> this.startListener());
But Now I What to convert this code in hooks inside the functional component.
Useeffect(()=>{
startListener());
},[liveMatches,isLoading,runningFetch,disbleSportsSwitch])
Please check is it correct or not ?