Course lesson
Manually settle a promise using Promise.withResolvers
If we want to be able to modify the state of a promise from outside the constructor, we can use the Promise.withResolvers method to get access to the promise, and its resolve and reject functions.
- Duration
- 2 min
- Access
- Free
- Transcript
- Retained from source evidence
If we want to be able to modify the state of a promise from outside the constructor, we can use the Promise.withResolvers method to get access to the promise, and its resolve and reject functions.