WEBVTT

1
00:00:00.000 --> 00:00:02.809
A promise is always going to be
in one of three possible states,

2
00:00:02.809 --> 00:00:05.408
pending, fulfilled, or rejected.

3
00:00:05.408 --> 00:00:09.202
The pending state is like the waiting
state you're in after being handed

4
00:00:09.202 --> 00:00:09.832
the pager.

5
00:00:09.832 --> 00:00:12.160
It's the default state of a promise.

6
00:00:12.160 --> 00:00:15.956
Fulfilled means that the operation
completed successfully.

7
00:00:15.956 --> 00:00:19.180
And rejected means that
the operation failed.

8
00:00:19.180 --> 00:00:22.264
Working with promises is
a three step sequence.

9
00:00:22.264 --> 00:00:26.429
You create a promise instance
using the Promise() constructor.

10
00:00:26.429 --> 00:00:30.000
You then define what should happen when
the promise is fulfilled or rejected.
