DEV Community

Discussion on: JavaScript: Concept of Promise

Collapse
 
swarnaliroy94 profile image
Swarnali Roy • Edited

Pending state starts while generating the promise, until it is either resolved or rejected. That means, until you get any result, successful or failure, the state is pending.
Well, if you working with React or React Native, in that case you can set the initial state as pending state, set resolve in then section and set reject in catch section. I'll write about it later in another post clearly.