Check out this code snippet:
function generateRandomTeams() {
const prom = new Promise(() => {
// ...
console.log('teams', props.state.teams) // logs
})
.then(() => {
console.log('here') // doesn't log
})
}
I'm facing an issue where the functions inside .then(() =>
are not getting executed after the initial block. I haven't included a return statement in the process.
Any suggestions on how I can successfully trigger the delayed promise call? Your help is greatly appreciated.