Skip to content

Commit 5f47ff8

Browse files
committed
Add more comments to example
1 parent dfde1f4 commit 5f47ff8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ function Loader() {
3636
}
3737
// This is the ‘loading’ state
3838
function* loading() {
39+
// This function will be called when this state is entered.
40+
// Its return value is available at `loader.resolved.fetchData`
3941
yield entry(fetchData);
42+
// If the promise succeeds, we will transition to the `success` state
43+
// If the promise fails, we will transition to the `failure` state
4044
yield on("SUCCESS", success);
4145
yield on("FAILURE", failure);
4246
}
43-
// States can be final
47+
// States that don’t yield anything are final
4448
function* success() {}
4549
// Or they can define transitions to other states
4650
function* failure() {

0 commit comments

Comments
 (0)