I’m trying to put pending promise on hold when a user clicks on button or change tab, etc. Basically, Is it possible to make sure that pending promises are only resolved when a certain condition is met? And keep it pending until the condition changes? I tried to chain promises like these but it doesn’t seem to work:
Thanks! But I don’t think my problem relates to these examples. What I am trying to do is to just resolve/reject the promise when the condition isHidden is met. Otherwise, I want to keep it pending as long as isHidden is false. So I think it’s definitely not an if… else between reject and resolve, but between pending and reject/resolve.