@@ -138,7 +138,7 @@ export const createInstance = (defaultProps = {}) => {
138
138
* @prop {boolean } persist Show until we have data, even while loading or when an error occurred
139
139
* @prop {Function|Node } children Function (passing state) or React node
140
140
*/
141
- Async . Pending = ( { children, persist } ) => (
141
+ const Pending = ( { children, persist } ) => (
142
142
< Consumer >
143
143
{ state => {
144
144
if ( state . data !== undefined ) return null
@@ -155,7 +155,7 @@ export const createInstance = (defaultProps = {}) => {
155
155
* @prop {boolean } initial Show only on initial load (data is undefined)
156
156
* @prop {Function|Node } children Function (passing state) or React node
157
157
*/
158
- Async . Loading = ( { children, initial } ) => (
158
+ const Loading = ( { children, initial } ) => (
159
159
< Consumer >
160
160
{ state => {
161
161
if ( ! state . isLoading ) return null
@@ -171,7 +171,7 @@ export const createInstance = (defaultProps = {}) => {
171
171
* @prop {boolean } persist Show old data while loading
172
172
* @prop {Function|Node } children Function (passing data and state) or React node
173
173
*/
174
- Async . Resolved = ( { children, persist } ) => (
174
+ const Resolved = ( { children, persist } ) => (
175
175
< Consumer >
176
176
{ state => {
177
177
if ( state . data === undefined ) return null
@@ -188,7 +188,7 @@ export const createInstance = (defaultProps = {}) => {
188
188
* @prop {boolean } persist Show old error while loading
189
189
* @prop {Function|Node } children Function (passing error and state) or React node
190
190
*/
191
- Async . Rejected = ( { children, persist } ) => (
191
+ const Rejected = ( { children, persist } ) => (
192
192
< Consumer >
193
193
{ state => {
194
194
if ( state . error === undefined ) return null
@@ -198,6 +198,11 @@ export const createInstance = (defaultProps = {}) => {
198
198
</ Consumer >
199
199
)
200
200
201
+ Async . Pending = Pending
202
+ Async . Loading = Loading
203
+ Async . Resolved = Resolved
204
+ Async . Rejected = Rejected
205
+
201
206
return Async
202
207
}
203
208
0 commit comments