Skip to content

Commit c9c043a

Browse files
committed
♻️ README updated with better usage explanation
1 parent 0c7c8c5 commit c9c043a

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

README.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ or
2020
yarn add babel-plugin-macros better-async-await.macro --dev
2121
```
2222

23+
**.babelrc**
24+
25+
```json
26+
{
27+
"plugins": ["babel-plugin-macros"]
28+
}
29+
```
30+
2331
## Installation with CRA >= 2.0
2432

2533
```sh
@@ -34,32 +42,9 @@ yarn add better-async-await.macro --dev
3442

3543
## ⭐ Usage
3644

37-
### Via `.babelrc` with CRA < 2.0
38-
39-
> Please install `babel-plugin-macros`
40-
41-
```sh
42-
npm install --save-dev babel-plugin-macros
43-
```
44-
45-
or
46-
47-
```sh
48-
yarn add babel-plugin-macros --dev
49-
```
50-
51-
52-
**.babelrc**
53-
54-
```json
55-
{
56-
"plugins": ["babel-plugin-macros"]
57-
}
58-
```
59-
60-
## ⭐ Usage in code
61-
6245
```javascript
46+
import betterAsyncAwait 'better-async-await.macro';
47+
6348
async function test() {
6449
const [err, resp] = await betterAsyncAwait(api.getData(5));
6550
if(err) handleError();

0 commit comments

Comments
 (0)