File tree Expand file tree Collapse file tree 1 file changed +10
-25
lines changed Expand file tree Collapse file tree 1 file changed +10
-25
lines changed Original file line number Diff line number Diff line change 20
20
yarn add babel-plugin-macros better-async-await.macro --dev
21
21
```
22
22
23
+ ** .babelrc**
24
+
25
+ ``` json
26
+ {
27
+ "plugins" : [" babel-plugin-macros" ]
28
+ }
29
+ ```
30
+
23
31
## Installation with CRA >= 2.0
24
32
25
33
``` sh
@@ -34,32 +42,9 @@ yarn add better-async-await.macro --dev
34
42
35
43
## ⭐ Usage
36
44
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
-
62
45
``` javascript
46
+ import betterAsyncAwait ' better-async-await.macro' ;
47
+
63
48
async function test () {
64
49
const [err , resp ] = await betterAsyncAwait (api .getData (5 ));
65
50
if (err) handleError ();
You can’t perform that action at this time.
0 commit comments