File tree 2 files changed +23
-6
lines changed
2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,16 @@ import {
8
8
RejectedChildren ,
9
9
SettledChildren ,
10
10
AsyncState ,
11
+ AbstractState ,
11
12
} from "./Async"
12
13
14
+ /**
15
+ * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need
16
+ * AbstractState imported in this file, even though it is only used implicitly.
17
+ * This _uses_ AbstractState so it is not accidentally removed by someone.
18
+ */
19
+ declare type ImportWorkaround < T > = AbstractState < T > ;
20
+
13
21
// these were exported as type, but never existed
14
22
// export declare function IfLoading<T>(props: {
15
23
// children?: PendingChildren<T>
@@ -80,8 +88,8 @@ export const IfFulfilled = <T extends {}>({
80
88
persist ?: boolean
81
89
state : AsyncState < T >
82
90
} ) => (
83
- < > { state . isFulfilled || ( persist && state . data ) ? renderFn ( children , state . data , state ) : null } </ >
84
- )
91
+ < > { state . isFulfilled || ( persist && state . data ) ? renderFn ( children , state . data , state ) : null } </ >
92
+ )
85
93
86
94
/**
87
95
* Renders only when promise is rejected.
@@ -99,10 +107,10 @@ export const IfRejected = <T extends {}>({
99
107
persist ?: boolean
100
108
state : AsyncState < T >
101
109
} ) => (
102
- < >
103
- { state . isRejected || ( persist && state . error ) ? renderFn ( children , state . error , state ) : null }
104
- </ >
105
- )
110
+ < >
111
+ { state . isRejected || ( persist && state . error ) ? renderFn ( children , state . error , state ) : null }
112
+ </ >
113
+ )
106
114
107
115
/**
108
116
* Renders only when promise is fulfilled or rejected.
Original file line number Diff line number Diff line change @@ -7,8 +7,17 @@ import {
7
7
AsyncFulfilled ,
8
8
AsyncRejected ,
9
9
AsyncInitial ,
10
+ AbstractState ,
10
11
} from "./Async"
11
12
13
+ /**
14
+ * Due to https://github.com/microsoft/web-build-tools/issues/1050, we need
15
+ * AbstractState imported in this file, even though it is only used implicitly.
16
+ * This _uses_ AbstractState so it is not accidentally removed by someone.
17
+ */
18
+ declare type ImportWorkaround < T > = AbstractState < T > ;
19
+
20
+
12
21
export enum actionTypes {
13
22
start = "start" ,
14
23
cancel = "cancel" ,
You can’t perform that action at this time.
0 commit comments