File tree 4 files changed +50
-13
lines changed
4 files changed +50
-13
lines changed Original file line number Diff line number Diff line change 15
15
"start" : " run-p start:*" ,
16
16
"start:examples" : " now dev" ,
17
17
"start:storybook" : " start-storybook -p 6006" ,
18
- "lint" : " eslint packages/*/src/*.{j,t}{s,sx }" ,
18
+ "lint" : " eslint packages/*/src/*.{js,ts,tsx }" ,
19
19
"test" : " jest packages/*/src/*.spec.js" ,
20
20
"test:watch" : " yarn test -- --watch" ,
21
21
"test:devtools" : " jest react-async-devtools/src" ,
76
76
"react-dom" : " 16.9.0" ,
77
77
"storybook-chromatic" : " 2.2.2"
78
78
}
79
- }
79
+ }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
16
16
* AbstractState imported in this file, even though it is only used implicitly.
17
17
* This _uses_ AbstractState so it is not accidentally removed by someone.
18
18
*/
19
- declare type ImportWorkaround < T > = AbstractState < T > ;
19
+ declare type ImportWorkaround < T > = AbstractState < T >
20
20
21
21
// these were exported as type, but never existed
22
22
// export declare function IfLoading<T>(props: {
@@ -88,8 +88,8 @@ export const IfFulfilled = <T extends {}>({
88
88
persist ?: boolean
89
89
state : AsyncState < T >
90
90
} ) => (
91
- < > { state . isFulfilled || ( persist && state . data ) ? renderFn ( children , state . data , state ) : null } </ >
92
- )
91
+ < > { state . isFulfilled || ( persist && state . data ) ? renderFn ( children , state . data , state ) : null } </ >
92
+ )
93
93
94
94
/**
95
95
* Renders only when promise is rejected.
@@ -107,10 +107,10 @@ export const IfRejected = <T extends {}>({
107
107
persist ?: boolean
108
108
state : AsyncState < T >
109
109
} ) => (
110
- < >
111
- { state . isRejected || ( persist && state . error ) ? renderFn ( children , state . error , state ) : null }
112
- </ >
113
- )
110
+ < >
111
+ { state . isRejected || ( persist && state . error ) ? renderFn ( children , state . error , state ) : null }
112
+ </ >
113
+ )
114
114
115
115
/**
116
116
* Renders only when promise is fulfilled or rejected.
Original file line number Diff line number Diff line change 1
1
import Async from "./Async"
2
- export { default as Async , createInstance } from "./Async"
3
- export { default as useAsync , useFetch } from "./useAsync"
2
+ export {
3
+ default as Async ,
4
+ createInstance ,
5
+ PromiseFn ,
6
+ InitialChildren ,
7
+ PendingChildren ,
8
+ FulfilledChildren ,
9
+ Start ,
10
+ Cancel ,
11
+ Reject ,
12
+ AsyncProps ,
13
+ RejectedChildren ,
14
+ SettledChildren ,
15
+ DeferFn ,
16
+ Fulfill ,
17
+ AsyncAction ,
18
+ AbstractState ,
19
+ AsyncInitial ,
20
+ AsyncPending ,
21
+ AsyncFulfilled ,
22
+ AsyncChildren ,
23
+ AsyncOptions ,
24
+ AsyncRejected ,
25
+ AsyncState ,
26
+ } from "./Async"
27
+ export { default as useAsync , useFetch , FetchOptions } from "./useAsync"
4
28
export default Async
5
29
export { statusTypes } from "./status"
6
30
export { default as globalScope } from "./globalScope"
7
31
export * from "./helpers"
8
32
export * from "./reducer"
33
+
34
+ /*
35
+ > RejectedChildren
36
+ > SettledChildren
37
+ > PromiseFn
38
+ > DeferFn
39
+ > Fulfill
40
+ > AsyncAction
41
+ > AbstractState
42
+ > AsyncInitial
43
+ > AsyncPending
44
+ > AsyncFulfilled
45
+ > AsyncInitialWithout
46
+ */
Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ import {
15
15
* AbstractState imported in this file, even though it is only used implicitly.
16
16
* This _uses_ AbstractState so it is not accidentally removed by someone.
17
17
*/
18
- declare type ImportWorkaround < T > = AbstractState < T > ;
19
-
18
+ declare type ImportWorkaround < T > = AbstractState < T >
20
19
21
20
export enum actionTypes {
22
21
start = "start" ,
You can’t perform that action at this time.
0 commit comments