Skip to content

Commit 68f15eb

Browse files
committed
Update README.md
1 parent 879193a commit 68f15eb

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ Thunk [middleware](http://rackt.github.io/redux/docs/advanced/Middleware.html) f
1111
npm install --save redux-thunk
1212
```
1313

14-
## What’s a thunk?!
15-
16-
A [thunk](https://en.wikipedia.org/wiki/Thunk) is a function that wraps an expression to delay its evaluation.
14+
## Why Do I Need This?
1715

18-
```js
19-
// calculation of 1 + 2 is immediate
20-
// x === 3
21-
let x = 1 + 2;
16+
If you’re not sure whether you need it, you probably don’t.
2217

23-
// calculation of 1 + 2 is delayed
24-
// foo can be called later to perform the calculation
25-
// foo is a thunk!
26-
let foo = () => 1 + 2;
27-
```
18+
**[Read this for an in-depth introduction to thunks in Redux.](http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559#35415559)**
2819

2920
## Motivation
3021

@@ -67,6 +58,22 @@ function incrementIfOdd() {
6758
}
6859
```
6960

61+
## What’s a thunk?!
62+
63+
A [thunk](https://en.wikipedia.org/wiki/Thunk) is a function that wraps an expression to delay its evaluation.
64+
65+
```js
66+
// calculation of 1 + 2 is immediate
67+
// x === 3
68+
let x = 1 + 2;
69+
70+
// calculation of 1 + 2 is delayed
71+
// foo can be called later to perform the calculation
72+
// foo is a thunk!
73+
let foo = () => 1 + 2;
74+
```
75+
76+
7077
## Installation
7178

7279
```

0 commit comments

Comments
 (0)